package com.example.choupaiapp.main.fragment.home;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ImageSpan;
import android.text.style.StyleSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget;
import com.dueeeke.videocontroller.StandardVideoController;
import com.dueeeke.videoplayer.player.VideoView;
import com.dueeeke.videoplayer.player.VideoViewManager;
import com.dueeeke.videoplayer.util.PlayerUtils;
import com.example.choupaiapp.R;
import com.example.choupaiapp.common.adapter.BaseAdapterHelper;
import com.example.choupaiapp.common.adapter.QuickAdapter;
import com.example.choupaiapp.common.constant.Contacts;
import com.example.choupaiapp.common.finalokgo.callback.Callback;
import com.example.choupaiapp.common.finalokgo.request.RequestType;
import com.example.choupaiapp.common.ui.fragment.CommonFragment;
import com.example.choupaiapp.common.util.ContextUtil;
import com.example.choupaiapp.common.util.DialogUtil;
import com.example.choupaiapp.common.util.GsonUtil;
import com.example.choupaiapp.common.util.SharedPreferencesHelp;
import com.example.choupaiapp.common.util.Utils;
import com.example.choupaiapp.common.view.XListView;
import com.example.choupaiapp.main.activity.find.FindDetailActivity;
import com.example.choupaiapp.main.activity.find.FindOtherInfoActivity;
import com.example.choupaiapp.main.activity.home.InvitationDetailActivity;
import com.example.choupaiapp.main.activity.home.OtherInfoActivity;
import com.example.choupaiapp.main.activity.home.VideoDetailActivity;
import com.example.choupaiapp.main.activity.mine.ReportActivity;
import com.example.choupaiapp.main.bean.ContentVoteListBean;
import com.example.choupaiapp.main.bean.HomeChildBean;
import com.example.choupaiapp.main.bean.RemindJson;
import com.example.choupaiapp.main.bean.SendCodeBean;
import com.example.choupaiapp.main.bean.ShareDataBean;
import com.example.choupaiapp.main.bean.ShareFindBean;
import com.example.choupaiapp.main.bean.UserInfoBean;
import com.example.choupaiapp.main.bean.VideoListBean;
import com.example.choupaiapp.main.callback.OnImageClickListener;
import com.example.choupaiapp.main.callback.WechatCallBack;
import com.example.choupaiapp.main.constant.Config;
import com.example.choupaiapp.main.constant.Url;
import com.example.choupaiapp.main.util.WXShareUtil;
import com.example.choupaiapp.main.util.WechatLoginUtil;
import com.example.choupaiapp.main.util.jpush.ExampleUtil;
import com.example.choupaiapp.main.util.video.PreloadManager;
import com.example.choupaiapp.main.util.video.VideoHashMap;
import com.example.choupaiapp.main.view.CenterAlignImageSpan;
import com.example.choupaiapp.main.view.MyNineGridView;
import com.example.choupaiapp.main.view.MyNineGridViewAdapter;
import com.example.choupaiapp.main.view.video.ScaleFrameLayout;
import com.lzy.ninegrid.ImageInfo;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.model.Response;
import com.orhanobut.logger.Logger;
import com.scwang.smartrefresh.header.MaterialHeader;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.constant.RefreshState;
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
import com.shuyu.textutillib.RichTextView;
import com.shuyu.textutillib.listener.SpanAtUserCallBack;
import com.shuyu.textutillib.model.UserModel;
import com.sina.weibo.sdk.WbSdk;
import com.sina.weibo.sdk.api.TextObject;
import com.sina.weibo.sdk.api.WeiboMultiMessage;
import com.sina.weibo.sdk.auth.AuthInfo;
import com.sina.weibo.sdk.share.WbShareCallback;
import com.sina.weibo.sdk.share.WbShareHandler;
import com.tencent.connect.share.QQShare;
import com.tencent.connect.share.QzoneShare;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.Tencent;
import com.tencent.tauth.UiError;
import com.umeng.analytics.MobclickAgent;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import cn.jpush.android.api.JPushInterface;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by ASUS on 2019/11/4.
 */

public class RecommendFragment extends CommonFragment implements OnRefreshLoadMoreListener, WbShareCallback, WechatCallBack {

    @BindView(R.id.listview)
    ListView listview;
    @BindView(R.id.refreshLayout)
    SmartRefreshLayout refreshLayout;
    @BindView(R.id.empty_img)
    ImageView empty_img;
    Unbinder unbinder;
    @BindView(R.id.no_data)
    TextView no_data;
    private QuickAdapter<HomeChildBean.ListBean> quickAdapter;
    private String categoriesId;
    private UserInfoBean mUserInfoBean;
    private PreloadManager mPreloadManager;
    private int currentPlayPosition = -1;
    private Tencent mTencent;
    private double lat = 0;
    private double lot = 0;
    private int contentId;
    private int moduleInt;
    private WbShareHandler shareHandler;
    private BaseUiListener baseUiListener;
    private TextView time_tv;
    private TextView count_sum;
    private TextView date_add;
    private TextView add_count_sum;
    private TextView suspected_count;
    private TextView suspected_add;
    private TextView cure_count;
    private TextView cure_add;
    private TextView death_count;
    private TextView death_add;
    private TextView local_province;
    private TextView local_city;
    private TextView province_count;
    private TextView city_count;
    private TextView province_cure;
    private TextView city_cure;
    private TextView province_death;
    private TextView city_death;
    private Drawable drawable;
    private Drawable drawable1;


    SpanAtUserCallBack spanAtUserCallBack = new SpanAtUserCallBack() {
        @Override
        public void onClick(View view, UserModel userModel1) {
            Bundle bundle = new Bundle();
            bundle.putString("userId", userModel1.getUser_id());
            bundle.putString("userName", userModel1.getUser_name());
            startActivity(OtherInfoActivity.class, bundle);
            if (view instanceof TextView) {
                ((TextView) view).setHighlightColor(Color.TRANSPARENT);
            }
        }
    };
    private CenterAlignImageSpan imageSpan1;
    private CenterAlignImageSpan imageSpan;
    private StyleSpan span;


    public static RecommendFragment newInstance(String categoriesId, double lat, double lot) {
        RecommendFragment recommendFragment = new RecommendFragment();
        recommendFragment.categoriesId = categoriesId;
        recommendFragment.lat = lat;
        recommendFragment.lot = lot;
        return recommendFragment;
    }

    /**
     * 将播放器从父控件中移除
     */
    private void removePlayerFormParent(VideoView mVideoView) {
        if (mVideoView != null) {
            ViewParent parent = mVideoView.getParent();
            if (parent instanceof FrameLayout) {
                ((FrameLayout) parent).removeView(mVideoView);
            }
        }

    }

    private long formattingtime;
    private long TimeCha;

    private void timecha(String startime, TextView textView) {
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat dataformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long currenttime = calendar.getTimeInMillis();//获取系统当先时间的毫秒值
        try {//如果你的初始时间是格式化过的,则需要先转化成毫秒值
            formattingtime = dataformat.parse(startime).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
//这里需要注意,因为获取的时间因为时差的缘故已经自动加上了8小时的时间,所以这里需要减去.如果不减去,就算是你刚刚发布的动态也会显示是8小时之前
        TimeCha = ((currenttime - formattingtime) / 1000) /*- (8 * 60 * 60)*/;//将毫秒值转化成分钟数
//        Logger.e(TimeCha+"");
        if (TimeCha < 60) {
            textView.setText("刚刚");
        } else if (TimeCha >= 60 && TimeCha < 3600) {
            textView.setText(TimeCha / 60 + "分钟前");
        } else if (TimeCha >= 3600 && TimeCha < 3600 * 24) {
            textView.setText(TimeCha / 3600 + "小时前");
        } else if (TimeCha >= 3600 * 1 * 24 && TimeCha < 3600 * 31 * 24) {
            textView.setText(TimeCha / 3600 / 24 + "天前");
        } else if (TimeCha >= 3600 * 31 * 24 * 1 && TimeCha < 3600 * 31 * 24 * 12) {
            textView.setText(TimeCha / 3600 / 24 / 30 + "个月前");
        } else {
            textView.setText(TimeCha / 3600 / 24 / 30 / 12 + "年前");
        }
    }


    @Override
    protected View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_recommend, container, false);
        unbinder = ButterKnife.bind(this, view);

        drawable = context.getResources().getDrawable(R.mipmap.icon_comment_official);
        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());

        drawable1 = context.getResources().getDrawable(R.mipmap.icon_comment_god);
        drawable1.setBounds(0, 0, drawable1.getMinimumWidth(), drawable1.getMinimumHeight());

        imageSpan1 = new CenterAlignImageSpan(drawable1);
        imageSpan = new CenterAlignImageSpan(drawable);
        span = new StyleSpan(Typeface.BOLD);

        EventBus.getDefault().register(this);

        refreshLayout.setOnRefreshLoadMoreListener(this);
        refreshLayout.setRefreshHeader(new MaterialHeader(context).setColorSchemeResources(R.color.common_color));
        refreshLayout.setEnableAutoLoadMore(true);

        mPreloadManager = PreloadManager.getInstance(context);

        mUserInfoBean = (UserInfoBean) SharedPreferencesHelp.getBean("userInfo");

        quickAdapter = new QuickAdapter<HomeChildBean.ListBean>(context, R.layout.item_recomend) {
            @Override
            protected void convert(BaseAdapterHelper helper, HomeChildBean.ListBean item) {
                LinearLayout container = helper.getView(R.id.container);

                if (item.getModule() == 1 || item.getModule() == 0) {
                    /**
                     * 动态
                     */
                    if (item.getType() == 1) {
                        if (item.getHeight() >= item.getWidth()) {
                            /**
                             * 4：3视频
                             */
                            container.removeAllViews();
                            View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_video_4_3, null, false);
                            container.addView(childView);

                            /**
                             * 点赞和评论数
                             */
                            TextView praise_tv = childView.findViewById(R.id.praise_tv);
                            praise_tv.setText(item.getLikeSum() + "");

                            TextView comment_tv = childView.findViewById(R.id.comment_tv);
                            comment_tv.setText(item.getCommentSum() + "");

                            /**
                             *时间
                             */
                            TextView time = childView.findViewById(R.id.time);
                            timecha(item.getCreateTime(), time);

                            /**
                             * 详情页点击事件
                             */
                            LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                            item_ll.setOnClickListener(view13 -> {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                currentPlayPosition = item.getId();
                                Bundle bundle = new Bundle();
                                bundle.putString("flag", "video_4_3");
                                bundle.putSerializable("data", item);
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(InvitationDetailActivity.class, bundle);
                            });
                            item_ll.setTag(helper.getPosition());

                            /**
                             * 视频播放和点击事件
                             */
                            ScaleFrameLayout mcontainer = childView.findViewById(R.id.my_container);
                            VideoView myVideoView_4_3 = VideoHashMap.getIntance().get(item.getId());
                            mcontainer.removeAllViews();
                            removePlayerFormParent(myVideoView_4_3);

                            if (!TextUtils.isEmpty(item.getUrls())) {
                                String playUrl = mPreloadManager.getPlayUrl(item.getUrls());
                                myVideoView_4_3.setUrl(playUrl);
                                StandardVideoController controller1 = new StandardVideoController(context);
                                myVideoView_4_3.setVideoController(controller1);
                                controller1.setPlayState(myVideoView_4_3.getCurrentPlayState());
                                controller1.setPlayerState(myVideoView_4_3.getCurrentPlayerState());
                                Glide.with(context)
                                        .load(item.getUrls() + "?vframe/jpg/offset/1")
                                        .crossFade()
                                        .placeholder(android.R.color.darker_gray)
                                        .into(controller1.getThumb());
                                myVideoView_4_3.setLooping(true);
                                myVideoView_4_3.setScreenScaleType(VideoView.SCREEN_SCALE_CENTER_CROP);

                                myVideoView_4_3.setMute(true);

                                controller1.getThumb().setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_4_3.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getUrls());
                                        videoListBean.setCoverImgUrl(item.getUrls() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller1.findViewById(R.id.start_play).setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_4_3.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getUrls());
                                        videoListBean.setCoverImgUrl(item.getUrls() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller1.setOnClickListener(view12 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    myVideoView_4_3.setVideoController(null);
                                    Bundle bundle = new Bundle();
                                    VideoListBean videoListBean = new VideoListBean();
                                    videoListBean.setVideoDownloadUrl(item.getUrls());
                                    videoListBean.setCoverImgUrl(item.getUrls() + "?vframe/jpg/offset/1");
                                    videoListBean.setTitle(item.getTitle());
                                    videoListBean.setComment_num(item.getCommentSum());
                                    videoListBean.setPraise_num(item.getLikeSum());
                                    videoListBean.setHeadPhoto(item.getAvatar());
                                    videoListBean.setNickName(item.getNickname());
                                    videoListBean.setTime(item.getCreateTime());
                                    videoListBean.setIsLike(item.getIsLike());
                                    videoListBean.setAnonymity(item.getAnonymity());
                                    videoListBean.setUserId(item.getUserId());
                                    videoListBean.setContentId(item.getId());
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    videoListBean.setList(remindJsons);
                                    bundle.putSerializable("data", videoListBean);
                                    bundle.putInt("videoId", item.getId());
                                    bundle.putString("categoriesId", categoriesId);
                                    bundle.putString("flag", "recommend");
                                    bundle.putInt("position", helper.getPosition());
                                    startActivity(VideoDetailActivity.class, bundle);
                                });
                            }

                            mcontainer.addView(myVideoView_4_3);

                            /**
                             * 评论按钮点击事件跳转详情页
                             */
                            ImageView comment = childView.findViewById(R.id.comment);
                            comment.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "video_4_3");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });

                            /**
                             * 自动弹出评论框后 发送评论
                             */
                            EditText comment_et = childView.findViewById(R.id.comment_et);
                            if (mUserInfoBean != null) {
                                CircleImageView image = childView.findViewById(R.id.image);
                                Glide.with(context)
                                        .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                        .override(56, 56)
                                        .centerCrop()
                                        .error(R.mipmap.icon_no_head)
                                        .into(image);
                            }
                            childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                        showDialog(context, "评论中...");
                                        MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("comment", comment_et.getText().toString().trim());
                                            jsonObject.put("position", 1);
                                            jsonObject.put("type", 1);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if (item.getCommentSum() < 2) {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().add(commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().set(0, commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    } else {
//                                        showImageToas("请填写点内容吧");
                                    }

                                }
                            });

                            /**
                             * 内容
                             */
                            RichTextView content = childView.findViewById(R.id.content);
                            if (!TextUtils.isEmpty(item.getTitle())) {
                                content.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        Bundle bundle = new Bundle();
                                        bundle.putString("flag", "video_4_3");
                                        bundle.putSerializable("data", item);
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(InvitationDetailActivity.class, bundle);
                                    }
                                });
                                if (!item.getTitle().equals(content.getTag())) {
                                    content.setTag(item.getTitle());
                                    List<UserModel> list = new ArrayList<>();
                                    if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        if (remindJsons != null) {
                                            for (int i = 0; i < remindJsons.size(); i++) {
                                                UserModel userModel = new UserModel();
                                                userModel.setUser_name(remindJsons.get(i).getNickname());
                                                userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                                list.add(userModel);
                                            }
                                        }
                                    }

                                    content.setVisibility(View.VISIBLE);

                                    //直接使用RichTextView
                                    content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                    content.setLinkColor(Color.BLUE);
                                    content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                    //所有配置完成后才设置text
                                    content.setRichTextUser(item.getTitle(), list);
                                }
                            } else {
                                content.setVisibility(View.GONE);
                            }

                            /**
                             * 位置
                             */
                            TextView location = childView.findViewById(R.id.location);
                            if (item.getIsTop() == 1) {
                                if ("1".equals(categoriesId)||"5".equals(categoriesId)) {
                                    if (!TextUtils.isEmpty(item.getAddress())) {
                                        location.setText(item.getAddress().split("\\|")[0]);
                                        location.setTextColor(getResources().getColor(R.color.color_9999));
                                    }
                                } else {
                                    location.setText("置顶");
                                    location.setTextColor(getResources().getColor(R.color.color_333));
                                }
                            } else {
                                if (!TextUtils.isEmpty(item.getAddress())) {
                                    location.setText(item.getAddress().split("\\|")[0]);
                                    location.setTextColor(getResources().getColor(R.color.color_9999));
                                }
                            }


                            /**
                             * 昵称
                             */
                            TextView name = childView.findViewById(R.id.name);
                            name.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户无法查看主页");
                                    } else {
                                        Bundle bundle = new Bundle();
                                        bundle.putString("userId", item.getUserId() + "");
                                        bundle.putString("userName", item.getNickname());
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(OtherInfoActivity.class, bundle);
                                    }
                                }
                            });

                            /**
                             * 头像
                             */
                            CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                            /**
                             * 关注和点击事件
                             */
                            TextView follow = childView.findViewById(R.id.follow);

                            if (item.getAnonymity() == 1) {
                                Glide.with(context)
                                        .load("")
                                        .override(56, 56)
                                        .centerCrop()
                                        .dontAnimate()
                                        .placeholder(R.mipmap.head_anonymous_orange)
                                        .into(head_photo);

                                name.setText("匿名用户");

                                follow.setVisibility(View.INVISIBLE);
                            } else {
                                Glide.with(context)
                                        .load(item.getAvatar() + Config.IMAGE_LIM)
                                        .dontAnimate()
                                        .override(56, 56)
                                        .centerCrop()
                                        .error(R.mipmap.icon_no_head)
                                        .into(head_photo);

                                name.setText(item.getNickname());

                                if (mUserInfoBean != null) {
                                    if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                        if (item.getIsAttention() == 1) {
                                            follow.setVisibility(View.INVISIBLE);
                                        } else {
                                            follow.setVisibility(View.VISIBLE);
                                        }
                                        follow.setOnClickListener(new View.OnClickListener() {
                                            @Override
                                            public void onClick(View view) {
                                                if (Utils.isDoubleClick()) {
                                                    return;
                                                }
                                                showDialog(context, "关注中...");
                                                finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                    @Override
                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                        dismissDialog();
                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.getItem(i).setIsAttention(1);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                            EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                        } else {
                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                            } else {
                                                                showImageToas(sendCodeBean.getMsg());
                                                            }
                                                        }
                                                    }

                                                    @Override
                                                    public void onError(Response<String> response) {
                                                        super.onError(response);
                                                        dismissDialog();
                                                    }
                                                });
                                            }
                                        });
                                    }
                                } else {
                                    if (item.getIsAttention() == 1) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                    }
                                    follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            showDialog(context, "关注中...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(1);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });
                                }

                            }

                            /**
                             * 点赞接口
                             */
                            ImageView praise = childView.findViewById(R.id.praise);
                            if (item.getIsLike() == 1) {
                                praise.setImageResource(R.mipmap.icon_praise_select);
                            } else {
                                praise.setImageResource(R.mipmap.item_praise);
                            }
                            praise.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getIsLike() == 1) {
                                        praise.setEnabled(false);
                                        showDialog(context, "取消中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 1);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(0);
                                                    item.setLikeSum(item.getLikeSum() - 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    } else {
                                        praise.setEnabled(false);
                                        showDialog(context, "点赞中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 1);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(1);
                                                    item.setLikeSum(item.getLikeSum() + 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    }
                                }
                            });

                            /**
                             * 更多
                             */
                            LinearLayout more = childView.findViewById(R.id.more);
                            more.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getModule() == 4) {
                                        if (item.getIsAttention() != 1) {
                                            return;
                                        }
                                    }
                                    DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                    LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;
                                    LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                    LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                    LinearLayout report = dialog_more.findViewById(R.id.report);
                                    LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                    View line = dialog_more.findViewById(R.id.line);
                                    View viewline = dialog_more.findViewById(R.id.view);
                                    View view1 = dialog_more.findViewById(R.id.view1);

                                    if (mUserInfoBean != null) {
                                        if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                            report.setVisibility(View.GONE);
                                            black_list.setVisibility(View.GONE);
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                            viewline.setVisibility(View.GONE);
                                            view1.setVisibility(View.INVISIBLE);
                                            delete.setVisibility(View.VISIBLE);
                                        } else {
                                            if (item.getIsAttention() == 1) {
                                                if (item.getAnonymity() == 1) {
                                                    cancel_follow.setVisibility(View.GONE);
                                                    line.setVisibility(View.GONE);
                                                } else {
                                                    cancel_follow.setVisibility(View.VISIBLE);
                                                    line.setVisibility(View.VISIBLE);
                                                }
                                            } else {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            }
                                            viewline.setVisibility(View.VISIBLE);
                                            view1.setVisibility(View.INVISIBLE);
                                            report.setVisibility(View.VISIBLE);
                                            black_list.setVisibility(View.VISIBLE);
                                            delete.setVisibility(View.GONE);
                                        }
                                    } else {
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                    }

                                    delete.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "删除中...");
                                            HttpParams params = new HttpParams();
                                            params.put("contentId", item.getId());
                                            finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        quickAdapter.remove(item);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                    report.setOnClickListener(view19 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        Bundle bundle = new Bundle();
                                        bundle.putString("flag", "report");
                                        bundle.putString("contentId", item.getId() + "");
                                        bundle.putString("module", item.getModule() + "");
                                        bundle.putString("type", "1");
                                        bundle.putString("byUserId", item.getUserId() + "");
                                        startActivity(ReportActivity.class, bundle);
                                    });

                                    black_list.setOnClickListener(view110 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        if (item.getAnonymity() == 1) {
                                            showImageToas("匿名用户不能屏蔽");
                                        } else {
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "屏蔽中...");
                                            finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.remove(i);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }

                                    });

                                    cancel_follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "取消关注...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        if ("5".equals(categoriesId)) {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.remove(i);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        } else {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.getItem(i).setIsAttention(0);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        }
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                }
                            });

                            /**
                             *
                             * 跳转他人中心
                             */
                            RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                            head_photo_rl.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户无法查看主页");
                                    } else {
                                        Bundle bundle = new Bundle();
                                        bundle.putString("userId", item.getUserId() + "");
                                        bundle.putString("userName", item.getNickname());
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(OtherInfoActivity.class, bundle);
                                    }
                                }
                            });


                            /**
                             * 分享
                             */
                            ImageView share = childView.findViewById(R.id.share);
                            share.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    contentId = item.getId();
                                    showDialog(context, null);
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareDataBean>() {
                                        @Override
                                        public void onSuccess(ShareDataBean shareDataBean) {
                                            dismissDialog();
                                            if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                                showShareDialog(shareDataBean, 1);
                                            } else {
                                                if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(shareDataBean.getMsg());
                                                }
                                            }

                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });

                                }
                            });


                            /**
                             * 评论列表
                             */
                            XListView comment_listview = childView.findViewById(R.id.comment_listview);
                            TextView comment_count = childView.findViewById(R.id.comment_count);
                            comment_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                                @Override
                                public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                                    currentPlayPosition = item.getId();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "video_4_3");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });
                            if (item.getCommentSum() > 0) {
                                comment_count.setVisibility(View.VISIBLE);
                                comment_listview.setVisibility(View.VISIBLE);
                                comment_count.setText("共" + item.getCommentSum() + "条评论");

                                QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                        new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                                TextView comment = helper_comment.getView(R.id.comment);

                                                comment.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        currentPlayPosition = item.getId();
                                                        Bundle bundle = new Bundle();
                                                        bundle.putString("flag", "video_4_3");
                                                        bundle.putSerializable("data", item);
                                                        bundle.putInt("position", helper.getPosition());
                                                        bundle.putString("categoriesId", categoriesId);
                                                        startActivity(InvitationDetailActivity.class, bundle);
                                                    }
                                                });

                                                if (itemComment.getUserId() == item.getUserId()) {
                                                    if (item.getAnonymity() == 1) {
                                                        SpannableString content = null;

                                                        content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    } else {
                                                        SpannableString content = null;

                                                        content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    }
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                    comment.setText(content);
                                                }

                                            }
                                        };
                                comment_listview.setAdapter(commentAdapter);
                            } else {
                                comment_count.setVisibility(View.GONE);
                                comment_listview.setVisibility(View.GONE);
                            }

                            /**
                             * 投票
                             */
                            XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                            if (item.getIsVote() == 0) {
                                vote_num_listview.setVisibility(View.GONE);
                            } else {
                                vote_num_listview.setVisibility(View.VISIBLE);
                                QuickAdapter<ContentVoteListBean> voteAdapter =
                                        new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                                TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                                TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                                TextView vote_num = voteHelper.getView(R.id.vote_num);
                                                ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                                LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                                if (mUserInfoBean != null) {
                                                    if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        if (item.getIsVoted() == 1) {
                                                            vote_tab_yes.setVisibility(View.VISIBLE);
                                                            vote_num.setVisibility(View.VISIBLE);
                                                            progressBar.setVisibility(View.VISIBLE);
                                                            vote_tab_no.setVisibility(View.INVISIBLE);

                                                            vote_tab_yes.setText(voteItem.getName());
                                                            vote_num.setText(voteItem.getVoteSum() + "票");

                                                            progressBar.setMax(item.getVoteTotal());
                                                            progressBar.setProgress(voteItem.getVoteSum());
                                                        } else {
                                                            vote_tab_yes.setVisibility(View.INVISIBLE);
                                                            vote_num.setVisibility(View.INVISIBLE);
                                                            progressBar.setVisibility(View.INVISIBLE);
                                                            vote_tab_no.setVisibility(View.VISIBLE);

                                                            vote_tab_no.setText(voteItem.getName());
                                                        }
                                                    }
                                                } else {
                                                    vote_tab_yes.setVisibility(View.INVISIBLE);
                                                    vote_num.setVisibility(View.INVISIBLE);
                                                    progressBar.setVisibility(View.INVISIBLE);
                                                    vote_tab_no.setVisibility(View.VISIBLE);

                                                    vote_tab_no.setText(voteItem.getName());
                                                }

                                                item_ll.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        if (item.getIsVoted() == 1) {
                                                            if (voteItem.getIsVote() == 1) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "取消中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(0);
                                                                            item.setVoteTotal(item.getVoteTotal() - 1);
                                                                            voteItem.setIsVote(0);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        } else {
                                                            if (voteItem.getIsVote() == 0) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "投票中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(1);
                                                                            item.setVoteTotal(item.getVoteTotal() + 1);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                            voteItem.setIsVote(1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        }
                                                    }
                                                });

                                            }
                                        };
                                vote_num_listview.setAdapter(voteAdapter);
                            }
                        } else {
                            /**
                             * 3：2视频
                             */
                            container.removeAllViews();
                            View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_video_3_2, null, false);
                            container.addView(childView);

                            /**
                             * 点赞和评论数
                             */
                            TextView praise_tv = childView.findViewById(R.id.praise_tv);
                            praise_tv.setText(item.getLikeSum() + "");

                            TextView comment_tv = childView.findViewById(R.id.comment_tv);
                            comment_tv.setText(item.getCommentSum() + "");

                            /**
                             *时间
                             */
                            TextView time = childView.findViewById(R.id.time);
                            timecha(item.getCreateTime(), time);

                            /**
                             * 详情点击事件
                             */
                            LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                            item_ll.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "video_3_2");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });
                            item_ll.setTag(helper.getPosition());

                            /**
                             * 视频播放和点击事件
                             */
                            ScaleFrameLayout mcontainer = childView.findViewById(R.id.my_container);
                            VideoView myVideoView_3_2 = VideoHashMap.getIntance().get(item.getId());
                            mcontainer.removeAllViews();
                            removePlayerFormParent(myVideoView_3_2);

                            if (!TextUtils.isEmpty(item.getUrls())) {
                                String playUrl = mPreloadManager.getPlayUrl(item.getUrls());
                                myVideoView_3_2.setUrl(playUrl);
                                StandardVideoController controller = new StandardVideoController(context);
                                myVideoView_3_2.setVideoController(controller);
                                controller.setPlayState(myVideoView_3_2.getCurrentPlayState());
                                controller.setPlayerState(myVideoView_3_2.getCurrentPlayerState());
                                Glide.with(context)
                                        .load(item.getUrls() + "?vframe/jpg/offset/1")
                                        .crossFade()
                                        .placeholder(android.R.color.darker_gray)
                                        .into(controller.getThumb());
                                myVideoView_3_2.setLooping(true);
                                myVideoView_3_2.setScreenScaleType(VideoView.SCREEN_SCALE_CENTER_CROP);
                                myVideoView_3_2.setMute(true);

                                controller.getThumb().setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getUrls());
                                        videoListBean.setCoverImgUrl(item.getUrls() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller.findViewById(R.id.start_play).setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getUrls());
                                        videoListBean.setCoverImgUrl(item.getUrls() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getUrls());
                                        videoListBean.setCoverImgUrl(item.getUrls() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });
                            }

                            mcontainer.addView(myVideoView_3_2);

                            /**
                             * 评论框
                             */
                            RelativeLayout comment_rl = childView.findViewById(R.id.comment_rl);
                            if (item.isShowEdit()) {
                                comment_rl.setVisibility(View.VISIBLE);
                            } else {
                                comment_rl.setVisibility(View.GONE);
                            }
                            EditText comment_et = childView.findViewById(R.id.comment_et);
                            if (mUserInfoBean != null) {
                                CircleImageView image = childView.findViewById(R.id.image);
                                Glide.with(context)
                                        .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                        .override(56, 56)
                                        .centerCrop()
                                        .error(R.mipmap.icon_no_head)
                                        .into(image);
                            }
                            childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                        showDialog(context, "评论中...");
                                        MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("comment", comment_et.getText().toString().trim());
                                            jsonObject.put("position", 1);
                                            jsonObject.put("type", 1);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if (item.getCommentSum() < 2) {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().add(commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().set(0, commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    } else {
//                                        showImageToas("请填写点内容吧");
                                    }

                                }
                            });

                            /**
                             * 内容
                             */
                            RichTextView content = childView.findViewById(R.id.content);
                            if (!TextUtils.isEmpty(item.getTitle())) {
                                content.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        Bundle bundle = new Bundle();
                                        bundle.putString("flag", "video_3_2");
                                        bundle.putSerializable("data", item);
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(InvitationDetailActivity.class, bundle);
                                    }
                                });
                                if (!item.getTitle().equals(content.getTag())) {
                                    content.setTag(item.getTitle());
                                    List<UserModel> list = new ArrayList<>();
                                    if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        if (remindJsons != null) {
                                            for (int i = 0; i < remindJsons.size(); i++) {
                                                UserModel userModel = new UserModel();
                                                userModel.setUser_name(remindJsons.get(i).getNickname());
                                                userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                                list.add(userModel);
                                            }
                                        }
                                    }

                                    content.setVisibility(View.VISIBLE);

                                    //直接使用RichTextView
                                    content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                    content.setLinkColor(Color.BLUE);
                                    content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                    //所有配置完成后才设置text
                                    content.setRichTextUser(item.getTitle(), list);
                                }
                            } else {
                                content.setVisibility(View.GONE);
                            }

                            /**
                             * 位置
                             */
                            TextView location = childView.findViewById(R.id.location);
                            if (item.getIsTop() == 1) {
                                if ("1".equals(categoriesId)||"5".equals(categoriesId)) {
                                    if (!TextUtils.isEmpty(item.getAddress())) {
                                        location.setText(item.getAddress().split("\\|")[0]);
                                        location.setTextColor(getResources().getColor(R.color.color_9999));
                                    }
                                } else {
                                    location.setText("置顶");
                                    location.setTextColor(getResources().getColor(R.color.color_333));
                                }
                            } else {
                                if (!TextUtils.isEmpty(item.getAddress())) {
                                    location.setText(item.getAddress().split("\\|")[0]);
                                    location.setTextColor(getResources().getColor(R.color.color_9999));
                                }
                            }

                            /**
                             * 昵称
                             */
                            TextView name = childView.findViewById(R.id.name);
                            name.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户无法查看主页");
                                    } else {
                                        Bundle bundle = new Bundle();
                                        bundle.putString("userId", item.getUserId() + "");
                                        bundle.putString("userName", item.getNickname());
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(OtherInfoActivity.class, bundle);
                                    }
                                }
                            });

                            /**
                             *
                             * 跳转他人中心
                             */
                            RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                            head_photo_rl.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户无法查看主页");
                                    } else {
                                        Bundle bundle = new Bundle();
                                        bundle.putString("userId", item.getUserId() + "");
                                        bundle.putString("userName", item.getNickname());
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(OtherInfoActivity.class, bundle);
                                    }
                                }
                            });

                            /**
                             * 头像
                             */
                            CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                            /**
                             * 关注和点击事件
                             */
                            TextView follow = childView.findViewById(R.id.follow);

                            if (item.getAnonymity() == 1) {
                                Glide.with(context)
                                        .load("")
                                        .dontAnimate()
                                        .override(56, 56)
                                        .centerCrop()
                                        .placeholder(R.mipmap.head_anonymous_green)
                                        .into(head_photo);

                                name.setText("匿名用户");

                                follow.setVisibility(View.INVISIBLE);
                            } else {
                                Glide.with(context)
                                        .load(item.getAvatar() + Config.IMAGE_LIM)
                                        .dontAnimate()
                                        .override(56, 56)
                                        .centerCrop()
                                        .error(R.mipmap.icon_no_head)
                                        .into(head_photo);

                                name.setText(item.getNickname());

                                if (mUserInfoBean != null) {
                                    if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                        if (item.getIsAttention() == 1) {
                                            follow.setVisibility(View.INVISIBLE);
                                        } else {
                                            follow.setVisibility(View.VISIBLE);
                                        }
                                        follow.setOnClickListener(new View.OnClickListener() {
                                            @Override
                                            public void onClick(View view) {
                                                if (Utils.isDoubleClick()) {
                                                    return;
                                                }
                                                showDialog(context, "关注中...");
                                                finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                    @Override
                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                        dismissDialog();
                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.getItem(i).setIsAttention(1);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                            EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                        } else {
                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                            } else {
                                                                showImageToas(sendCodeBean.getMsg());
                                                            }
                                                        }
                                                    }

                                                    @Override
                                                    public void onError(Response<String> response) {
                                                        super.onError(response);
                                                        dismissDialog();
                                                    }
                                                });
                                            }
                                        });
                                    }
                                } else {
                                    if (item.getIsAttention() == 1) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                    }
                                    follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            showDialog(context, "关注中...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(1);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });
                                }
                            }

                            /**
                             * 点赞接口
                             */
                            ImageView praise = childView.findViewById(R.id.praise);
                            if (item.getIsLike() == 1) {
                                praise.setImageResource(R.mipmap.icon_praise_select);
                            } else {
                                praise.setImageResource(R.mipmap.item_praise);
                            }
                            praise.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getIsLike() == 1) {
                                        praise.setEnabled(false);
                                        showDialog(context, "取消中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 1);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(0);
                                                    item.setLikeSum(item.getLikeSum() - 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    } else {
                                        praise.setEnabled(false);
                                        showDialog(context, "点赞中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 1);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(1);
                                                    item.setLikeSum(item.getLikeSum() + 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    }
                                }
                            });

                            /**
                             * 更多
                             */
                            LinearLayout more = childView.findViewById(R.id.more);
                            more.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getModule() == 4) {
                                        if (item.getIsAttention() != 1) {
                                            return;
                                        }
                                    }
                                    DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                    LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;

                                    LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                    LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                    LinearLayout report = dialog_more.findViewById(R.id.report);
                                    LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                    View line = dialog_more.findViewById(R.id.line);
                                    View viewline = dialog_more.findViewById(R.id.view);
                                    View view1 = dialog_more.findViewById(R.id.view1);

                                    if (mUserInfoBean != null) {
                                        if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                            report.setVisibility(View.GONE);
                                            black_list.setVisibility(View.GONE);
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                            viewline.setVisibility(View.GONE);
                                            view1.setVisibility(View.INVISIBLE);
                                            delete.setVisibility(View.VISIBLE);
                                        } else {
                                            if (item.getIsAttention() == 1) {
                                                if (item.getAnonymity() == 1) {
                                                    cancel_follow.setVisibility(View.GONE);
                                                    line.setVisibility(View.GONE);
                                                } else {
                                                    cancel_follow.setVisibility(View.VISIBLE);
                                                    line.setVisibility(View.VISIBLE);
                                                }
                                            } else {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            }
                                            viewline.setVisibility(View.VISIBLE);
                                            view1.setVisibility(View.INVISIBLE);
                                            report.setVisibility(View.VISIBLE);
                                            black_list.setVisibility(View.VISIBLE);
                                            delete.setVisibility(View.GONE);
                                        }
                                    } else {
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                    }

                                    delete.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "删除中...");
                                            HttpParams params = new HttpParams();
                                            params.put("contentId", item.getId());
                                            finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        quickAdapter.remove(item);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                    report.setOnClickListener(view19 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        Bundle bundle = new Bundle();
                                        bundle.putString("flag", "report");
                                        bundle.putString("contentId", item.getId() + "");
                                        bundle.putString("module", item.getModule() + "");
                                        bundle.putString("type", "1");
                                        bundle.putString("byUserId", item.getUserId() + "");
                                        startActivity(ReportActivity.class, bundle);
                                    });

                                    black_list.setOnClickListener(view110 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        if (item.getAnonymity() == 1) {
                                            showImageToas("匿名用户不能屏蔽");
                                        } else {
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "屏蔽中...");
                                            finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.remove(i);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }

                                    });

                                    cancel_follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "取消关注...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        if ("5".equals(categoriesId)) {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.remove(i);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        } else {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.getItem(i).setIsAttention(0);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        }
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                }
                            });

                            /**
                             * 评论按钮点击事件跳转详情
                             */
                            ImageView comment = childView.findViewById(R.id.comment);
                            comment.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "video_3_2");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });


                            /**
                             * 分享
                             */
                            ImageView share = childView.findViewById(R.id.share);
                            share.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    contentId = item.getId();
                                    showDialog(context, null);
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareDataBean>() {
                                        @Override
                                        public void onSuccess(ShareDataBean shareDataBean) {
                                            dismissDialog();
                                            if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                                showShareDialog(shareDataBean, 1);
                                            } else {
                                                if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(shareDataBean.getMsg());
                                                }
                                            }

                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });

                                }
                            });


                            /**
                             * 评论列表
                             */
                            XListView comment_listview = childView.findViewById(R.id.comment_listview);
                            TextView comment_count = childView.findViewById(R.id.comment_count);
                            comment_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                                @Override
                                public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "video_3_2");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });
                            if (item.getCommentSum() > 0) {
                                comment_count.setVisibility(View.VISIBLE);
                                comment_listview.setVisibility(View.VISIBLE);
                                comment_count.setText("共" + item.getCommentSum() + "条评论");

                                QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                        new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                                TextView comment = helper_comment.getView(R.id.comment);

                                                comment.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        currentPlayPosition = item.getId();
                                                        Bundle bundle = new Bundle();
                                                        bundle.putString("flag", "video_3_2");
                                                        bundle.putSerializable("data", item);
                                                        bundle.putInt("position", helper.getPosition());
                                                        bundle.putString("categoriesId", categoriesId);
                                                        startActivity(InvitationDetailActivity.class, bundle);
                                                    }
                                                });
                                                if (itemComment.getUserId() == item.getUserId()) {
                                                    if (item.getAnonymity() == 1) {
                                                        SpannableString content = null;

                                                        content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    } else {
                                                        SpannableString content = null;

                                                        content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    }
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                    comment.setText(content);
                                                }

                                            }
                                        };
                                comment_listview.setAdapter(commentAdapter);
                            } else {
                                comment_count.setVisibility(View.GONE);
                                comment_listview.setVisibility(View.GONE);
                            }

                            /**
                             * 投票
                             */
                            XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                            if (item.getIsVote() == 0) {
                                vote_num_listview.setVisibility(View.GONE);
                            } else {
                                vote_num_listview.setVisibility(View.VISIBLE);
                                QuickAdapter<ContentVoteListBean> voteAdapter =
                                        new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                                TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                                TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                                TextView vote_num = voteHelper.getView(R.id.vote_num);
                                                ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                                LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                                if (mUserInfoBean != null) {
                                                    if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        if (item.getIsVoted() == 1) {
                                                            vote_tab_yes.setVisibility(View.VISIBLE);
                                                            vote_num.setVisibility(View.VISIBLE);
                                                            progressBar.setVisibility(View.VISIBLE);
                                                            vote_tab_no.setVisibility(View.INVISIBLE);

                                                            vote_tab_yes.setText(voteItem.getName());
                                                            vote_num.setText(voteItem.getVoteSum() + "票");

                                                            progressBar.setMax(item.getVoteTotal());
                                                            progressBar.setProgress(voteItem.getVoteSum());
                                                        } else {
                                                            vote_tab_yes.setVisibility(View.INVISIBLE);
                                                            vote_num.setVisibility(View.INVISIBLE);
                                                            progressBar.setVisibility(View.INVISIBLE);
                                                            vote_tab_no.setVisibility(View.VISIBLE);

                                                            vote_tab_no.setText(voteItem.getName());
                                                        }
                                                    }
                                                } else {
                                                    vote_tab_yes.setVisibility(View.INVISIBLE);
                                                    vote_num.setVisibility(View.INVISIBLE);
                                                    progressBar.setVisibility(View.INVISIBLE);
                                                    vote_tab_no.setVisibility(View.VISIBLE);

                                                    vote_tab_no.setText(voteItem.getName());
                                                }

                                                item_ll.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        if (item.getIsVoted() == 1) {
                                                            if (voteItem.getIsVote() == 1) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "取消中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(0);
                                                                            item.setVoteTotal(item.getVoteTotal() - 1);
                                                                            voteItem.setIsVote(0);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        } else {
                                                            if (voteItem.getIsVote() == 0) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "投票中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(1);
                                                                            item.setVoteTotal(item.getVoteTotal() + 1);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                            voteItem.setIsVote(1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        }
                                                    }
                                                });

                                            }
                                        };
                                vote_num_listview.setAdapter(voteAdapter);
                            }
                        }

                    } else if (item.getType() == 2) {
                        /**
                         * 图片
                         */
                        container.removeAllViews();
                        View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_img, null, false);
                        container.addView(childView);

                        /**
                         * 点赞和评论数
                         */
                        TextView praise_tv = childView.findViewById(R.id.praise_tv);
                        praise_tv.setText(item.getLikeSum() + "");

                        TextView comment_tv = childView.findViewById(R.id.comment_tv);
                        comment_tv.setText(item.getCommentSum() + "");

                        /**
                         *时间
                         */
                        TextView time = childView.findViewById(R.id.time);
                        timecha(item.getCreateTime(), time);

                        /**
                         * 详情点击事件
                         */
                        LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                        item_ll.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("flag", "img");
                                bundle.putSerializable("data", item);
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(InvitationDetailActivity.class, bundle);
                            }
                        });
                        item_ll.setTag(helper.getPosition());


                        /**
                         * 评论框
                         */
                        RelativeLayout comment_rl = childView.findViewById(R.id.comment_rl);
                        if (item.isShowEdit()) {
                            comment_rl.setVisibility(View.VISIBLE);
                        } else {
                            comment_rl.setVisibility(View.GONE);
                        }
                        EditText comment_et = childView.findViewById(R.id.comment_et);
                        if (mUserInfoBean != null) {
                            CircleImageView image = childView.findViewById(R.id.image);
                            Glide.with(context)
                                    .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                    .override(56, 56)
                                    .centerCrop()
                                    .error(R.mipmap.icon_no_head)
                                    .into(image);
                        }
                        childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                    showDialog(context, "评论中...");
                                    MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("comment", comment_et.getText().toString().trim());
                                        jsonObject.put("position", 1);
                                        jsonObject.put("type", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                if (item.getCommentSum() < 2) {
                                                    item.setCommentSum(item.getCommentSum() + 1);
                                                    HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                    commentListBean.setComment(comment_et.getText().toString().trim());
                                                    commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                    item.getCommentList().add(commentListBean);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    item.setCommentSum(item.getCommentSum() + 1);
                                                    HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                    commentListBean.setComment(comment_et.getText().toString().trim());
                                                    commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                    item.getCommentList().set(0, commentListBean);
                                                    quickAdapter.notifyDataSetChanged();
                                                }
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });
                                } else {
//                                    showImageToas("请填写点内容吧");
                                }

                            }
                        });

                        /**
                         * 内容
                         */
                        RichTextView content = childView.findViewById(R.id.content);
                        if (!TextUtils.isEmpty(item.getTitle())) {
                            content.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "img");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });
                            if (!item.getTitle().equals(content.getTag())) {
                                content.setTag(item.getTitle());
                                List<UserModel> list = new ArrayList<>();
                                if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    if (remindJsons != null) {
                                        for (int i = 0; i < remindJsons.size(); i++) {
                                            UserModel userModel = new UserModel();
                                            userModel.setUser_name(remindJsons.get(i).getNickname());
                                            userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                            list.add(userModel);
                                        }
                                    }
                                }

                                content.setVisibility(View.VISIBLE);
//                                content.setText(item.getTitle());

                                //直接使用RichTextView
                                content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                content.setLinkColor(Color.BLUE);
                                content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                //所有配置完成后才设置text
                                content.setRichTextUser(item.getTitle(), list);
                            }
                        } else {
                            content.setVisibility(View.GONE);
                        }

                        /**
                         * 位置
                         */
                        TextView location = childView.findViewById(R.id.location);
                        if (item.getIsTop() == 1) {
                            if ("1".equals(categoriesId)||"5".equals(categoriesId)) {
                                if (!TextUtils.isEmpty(item.getAddress())) {
                                    location.setText(item.getAddress().split("\\|")[0]);
                                    location.setTextColor(getResources().getColor(R.color.color_9999));
                                }
                            } else {
                                location.setText("置顶");
                                location.setTextColor(getResources().getColor(R.color.color_333));
                            }
                        } else {
                            if (!TextUtils.isEmpty(item.getAddress())) {
                                location.setText(item.getAddress().split("\\|")[0]);
                                location.setTextColor(getResources().getColor(R.color.color_9999));
                            }
                        }

                        /**
                         * 昵称
                         */
                        TextView name = childView.findViewById(R.id.name);
                        name.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getAnonymity() == 1) {
                                    showImageToas("匿名用户无法查看主页");
                                } else {
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(OtherInfoActivity.class, bundle);
                                }
                            }
                        });

                        /**
                         * 头像
                         */
                        CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                        /**
                         * 关注和点击事件
                         */
                        TextView follow = childView.findViewById(R.id.follow);

                        if (item.getAnonymity() == 1) {
                            Glide.with(context)
                                    .load("")
                                    .override(56, 56)
                                    .centerCrop()
                                    .dontAnimate()
                                    .placeholder(R.mipmap.head_anonymous_purple)
                                    .into(head_photo);

                            name.setText("匿名用户");

                            follow.setVisibility(View.INVISIBLE);
                        } else {
                            Glide.with(context)
                                    .load(item.getAvatar() + Config.IMAGE_LIM)
                                    .override(56, 56)
                                    .centerCrop()
                                    .dontAnimate()
                                    .error(R.mipmap.icon_no_head)
                                    .into(head_photo);

                            name.setText(item.getNickname());

                            if (mUserInfoBean != null) {
                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                    if (item.getIsAttention() == 1) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                    }
                                    follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            showDialog(context, "关注中...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(1);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });
                                }
                            } else {
                                if (item.getIsAttention() == 1) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                }
                                follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        showDialog(context, "关注中...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.getItem(i).setIsAttention(1);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });
                            }
                        }

                        /**
                         * 点赞接口
                         */
                        ImageView praise = childView.findViewById(R.id.praise);
                        if (item.getIsLike() == 1) {
                            praise.setImageResource(R.mipmap.icon_praise_select);
                        } else {
                            praise.setImageResource(R.mipmap.item_praise);
                        }
                        praise.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getIsLike() == 1) {
                                    praise.setEnabled(false);
                                    showDialog(context, "取消中...");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            praise.setEnabled(true);
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                item.setIsLike(0);
                                                item.setLikeSum(item.getLikeSum() - 1);
                                                quickAdapter.notifyDataSetChanged();
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                            praise.setEnabled(true);
                                        }
                                    });
                                } else {
                                    praise.setEnabled(false);
                                    showDialog(context, "点赞中...");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            praise.setEnabled(true);
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                item.setIsLike(1);
                                                item.setLikeSum(item.getLikeSum() + 1);
                                                quickAdapter.notifyDataSetChanged();
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                            praise.setEnabled(true);
                                        }
                                    });
                                }
                            }
                        });

                        /**
                         * 更多
                         */
                        LinearLayout more = childView.findViewById(R.id.more);
                        more.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getModule() == 4) {
                                    if (item.getIsAttention() != 1) {
                                        return;
                                    }
                                }
                                DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;

                                LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                LinearLayout report = dialog_more.findViewById(R.id.report);
                                LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                View line = dialog_more.findViewById(R.id.line);
                                View viewline = dialog_more.findViewById(R.id.view);
                                View view1 = dialog_more.findViewById(R.id.view1);

                                if (mUserInfoBean != null) {
                                    if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                        report.setVisibility(View.GONE);
                                        black_list.setVisibility(View.GONE);
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                        viewline.setVisibility(View.GONE);
                                        view1.setVisibility(View.INVISIBLE);
                                        delete.setVisibility(View.VISIBLE);
                                    } else {
                                        if (item.getIsAttention() == 1) {
                                            if (item.getAnonymity() == 1) {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            } else {
                                                cancel_follow.setVisibility(View.VISIBLE);
                                                line.setVisibility(View.VISIBLE);
                                            }
                                        } else {
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                        }
                                        viewline.setVisibility(View.VISIBLE);
                                        view1.setVisibility(View.INVISIBLE);
                                        report.setVisibility(View.VISIBLE);
                                        black_list.setVisibility(View.VISIBLE);
                                        delete.setVisibility(View.GONE);
                                    }
                                } else {
                                    cancel_follow.setVisibility(View.GONE);
                                    line.setVisibility(View.GONE);
                                }

                                delete.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "删除中...");
                                        HttpParams params = new HttpParams();
                                        params.put("contentId", item.getId());
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    quickAdapter.remove(item);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });

                                report.setOnClickListener(view19 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    DialogUtil.getInstance().dialog_center.dismiss();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "report");
                                    bundle.putString("contentId", item.getId() + "");
                                    bundle.putString("module", item.getModule() + "");
                                    bundle.putString("type", "1");
                                    bundle.putString("byUserId", item.getUserId() + "");
                                    startActivity(ReportActivity.class, bundle);
                                });

                                black_list.setOnClickListener(view110 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户不能屏蔽");
                                    } else {
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "屏蔽中...");
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.remove(i);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }

                                });

                                cancel_follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "取消关注...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if ("5".equals(categoriesId)) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.remove(i);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(0);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });

                            }
                        });


                        /**
                         *
                         * 跳转他人中心
                         */
                        RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                        head_photo_rl.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getAnonymity() == 1) {
                                    showImageToas("匿名用户无法查看主页");
                                } else {
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(OtherInfoActivity.class, bundle);
                                }
                            }
                        });

                        /**
                         * 分享
                         */
                        ImageView share = childView.findViewById(R.id.share);
                        share.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                contentId = item.getId();
                                showDialog(context, null);
                                JSONObject jsonObject = new JSONObject();
                                try {
                                    jsonObject.put("contentId", item.getId());
                                    jsonObject.put("module", 1);
                                } catch (JSONException e) {
                                    e.printStackTrace();
                                }
                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareDataBean>() {
                                    @Override
                                    public void onSuccess(ShareDataBean shareDataBean) {
                                        dismissDialog();
                                        if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                            showShareDialog(shareDataBean, 1);
                                        } else {
                                            if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                            } else {
                                                showImageToas(shareDataBean.getMsg());
                                            }
                                        }

                                    }

                                    @Override
                                    public void onError(Response<String> response) {
                                        super.onError(response);
                                        dismissDialog();
                                    }
                                });

                            }
                        });


                        /**
                         * 评论按钮点击事件跳转详情
                         */
                        ImageView comment = childView.findViewById(R.id.comment);
                        comment.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("flag", "img");
                                bundle.putSerializable("data", item);
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(InvitationDetailActivity.class, bundle);
                            }
                        });


                        /***
                         * 评论列表
                         */
                        XListView comment_listview = childView.findViewById(R.id.comment_listview);
                        TextView comment_count = childView.findViewById(R.id.comment_count);
                        if (item.getCommentSum() > 0) {
                            comment_count.setVisibility(View.VISIBLE);
                            comment_listview.setVisibility(View.VISIBLE);
                            comment_count.setText("共" + item.getCommentSum() + "条评论");

                            QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                    new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                        @Override
                                        protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                            TextView comment = helper_comment.getView(R.id.comment);

                                            comment.setOnClickListener(new View.OnClickListener() {
                                                @Override
                                                public void onClick(View view) {
                                                    if (Utils.isDoubleClick()) {
                                                        return;
                                                    }
                                                    Bundle bundle = new Bundle();
                                                    bundle.putString("flag", "img");
                                                    bundle.putSerializable("data", item);
                                                    bundle.putInt("position", helper.getPosition());
                                                    bundle.putString("categoriesId", categoriesId);
                                                    startActivity(InvitationDetailActivity.class, bundle);
                                                }
                                            });
                                            if (itemComment.getUserId() == item.getUserId()) {
                                                if (item.getAnonymity() == 1) {
                                                    SpannableString content = null;

                                                    content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                    comment.setText(content);
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                    comment.setText(content);
                                                }
                                            } else {
                                                SpannableString content = null;

                                                content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                if (itemComment.getWeight() == 1) {
                                                    content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                } else if (itemComment.getWeight() == -2) {
                                                    content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                } else {
                                                    content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                }
                                                content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                comment.setText(content);
                                            }

                                        }
                                    };
                            comment_listview.setAdapter(commentAdapter);
                        } else {
                            comment_count.setVisibility(View.GONE);
                            comment_listview.setVisibility(View.GONE);
                        }

                        /**
                         * 图片展示
                         */
                        if (!TextUtils.isEmpty(item.getUrls())) {
                            MyNineGridView nineGridView = childView.findViewById(R.id.nineGrid);
                            if (!item.getUrls().equals(nineGridView.getTag())) {
                                nineGridView.setTag(item.getUrls());
                                List<String> list = Arrays.asList(item.getUrls().split("\\|"));
                                ArrayList<ImageInfo> imageInfo = new ArrayList<>();
                                for (int i = 0; i < list.size(); i++) {
                                    ImageInfo info = new ImageInfo();
                                    info.setThumbnailUrl(list.get(i) + Config.IMAGE_LIM);
                                    info.setBigImageUrl(list.get(i));
                                    imageInfo.add(info);
                                }
                                nineGridView.setAdapter(new MyNineGridViewAdapter(context, imageInfo));
                            }
                        }

                        /**
                         * 投票
                         */
                        XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                        if (item.getIsVote() == 0) {
                            vote_num_listview.setVisibility(View.GONE);
                        } else {
                            vote_num_listview.setVisibility(View.VISIBLE);
                            QuickAdapter<ContentVoteListBean> voteAdapter =
                                    new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                        @Override
                                        protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                            TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                            TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                            TextView vote_num = voteHelper.getView(R.id.vote_num);
                                            ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                            LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                            if (mUserInfoBean != null) {
                                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                    vote_tab_yes.setVisibility(View.VISIBLE);
                                                    vote_num.setVisibility(View.VISIBLE);
                                                    progressBar.setVisibility(View.VISIBLE);
                                                    vote_tab_no.setVisibility(View.INVISIBLE);

                                                    vote_tab_yes.setText(voteItem.getName());
                                                    vote_num.setText(voteItem.getVoteSum() + "票");

                                                    progressBar.setMax(item.getVoteTotal());
                                                    progressBar.setProgress(voteItem.getVoteSum());
                                                } else {
                                                    if (item.getIsVoted() == 1) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        vote_tab_yes.setVisibility(View.INVISIBLE);
                                                        vote_num.setVisibility(View.INVISIBLE);
                                                        progressBar.setVisibility(View.INVISIBLE);
                                                        vote_tab_no.setVisibility(View.VISIBLE);

                                                        vote_tab_no.setText(voteItem.getName());
                                                    }
                                                }
                                            } else {
                                                vote_tab_yes.setVisibility(View.INVISIBLE);
                                                vote_num.setVisibility(View.INVISIBLE);
                                                progressBar.setVisibility(View.INVISIBLE);
                                                vote_tab_no.setVisibility(View.VISIBLE);

                                                vote_tab_no.setText(voteItem.getName());
                                            }

                                            item_ll.setOnClickListener(new View.OnClickListener() {
                                                @Override
                                                public void onClick(View view) {
                                                    if (Utils.isDoubleClick()) {
                                                        return;
                                                    }
                                                    if (item.getIsVoted() == 1) {
                                                        if (voteItem.getIsVote() == 1) {
                                                            item_ll.setEnabled(false);
                                                            showDialog(context, "取消中...");
                                                            JSONObject jsonObject = new JSONObject();
                                                            try {
                                                                jsonObject.put("contentVoteId", voteItem.getId());
                                                                jsonObject.put("contentId", voteItem.getContentId());
                                                            } catch (JSONException e) {
                                                                e.printStackTrace();
                                                            }
                                                            finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                @Override
                                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                        item.setIsVoted(0);
                                                                        item.setVoteTotal(item.getVoteTotal() - 1);
                                                                        voteItem.setIsVote(0);
                                                                        voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                        notifyDataSetChanged();
                                                                    } else {
                                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                        } else {
//                                                                            showImageToas(sendCodeBean.getMsg());
                                                                        }
                                                                    }
                                                                }

                                                                @Override
                                                                public void onError(Response<String> response) {
                                                                    super.onError(response);
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                }
                                                            });
                                                        }
                                                    } else {
                                                        if (voteItem.getIsVote() == 0) {
                                                            item_ll.setEnabled(false);
                                                            showDialog(context, "投票中...");
                                                            JSONObject jsonObject = new JSONObject();
                                                            try {
                                                                jsonObject.put("contentId", voteItem.getContentId());
                                                                jsonObject.put("contentVoteId", voteItem.getId());
                                                            } catch (JSONException e) {
                                                                e.printStackTrace();
                                                            }
                                                            finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                @Override
                                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                        item.setIsVoted(1);
                                                                        item.setVoteTotal(item.getVoteTotal() + 1);
                                                                        voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                        voteItem.setIsVote(1);
                                                                        notifyDataSetChanged();
                                                                    } else {
                                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                        } else {
//                                                                            showImageToas(sendCodeBean.getMsg());
                                                                        }
                                                                    }
                                                                }

                                                                @Override
                                                                public void onError(Response<String> response) {
                                                                    super.onError(response);
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                }
                                                            });
                                                        }
                                                    }
                                                }
                                            });

                                        }
                                    };
                            vote_num_listview.setAdapter(voteAdapter);
                        }

                    } else if (item.getType() == 3) {

                        /**
                         * 纯文字内容
                         */
                        container.removeAllViews();
                        View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_img, null, false);
                        container.addView(childView);

                        /**
                         * 点赞和评论数
                         */
                        TextView praise_tv = childView.findViewById(R.id.praise_tv);
                        praise_tv.setText(item.getLikeSum() + "");

                        TextView comment_tv = childView.findViewById(R.id.comment_tv);
                        comment_tv.setText(item.getCommentSum() + "");

                        /**
                         *时间
                         */
                        TextView time = childView.findViewById(R.id.time);
                        timecha(item.getCreateTime(), time);

                        /**
                         * 详情点击事件
                         */
                        LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                        item_ll.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("flag", "no_img");
                                bundle.putSerializable("data", item);
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(InvitationDetailActivity.class, bundle);
                            }
                        });
                        item_ll.setTag(helper.getPosition());


                        /**
                         * 评论框
                         */
                        RelativeLayout comment_rl = childView.findViewById(R.id.comment_rl);
                        if (item.isShowEdit()) {
                            comment_rl.setVisibility(View.VISIBLE);
                        } else {
                            comment_rl.setVisibility(View.GONE);
                        }
                        EditText comment_et = childView.findViewById(R.id.comment_et);
                        if (mUserInfoBean != null) {
                            CircleImageView image = childView.findViewById(R.id.image);
                            Glide.with(context)
                                    .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                    .override(56, 56)
                                    .centerCrop()
                                    .error(R.mipmap.icon_no_head)
                                    .into(image);
                        }
                        childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                    showDialog(context, "评论中...");
                                    MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("comment", comment_et.getText().toString().trim());
                                        jsonObject.put("position", 1);
                                        jsonObject.put("type", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                if (item.getCommentSum() < 2) {
                                                    item.setCommentSum(item.getCommentSum() + 1);
                                                    HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                    commentListBean.setComment(comment_et.getText().toString().trim());
                                                    commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                    item.getCommentList().add(commentListBean);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    item.setCommentSum(item.getCommentSum() + 1);
                                                    HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                    commentListBean.setComment(comment_et.getText().toString().trim());
                                                    commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                    item.getCommentList().set(0, commentListBean);
                                                    quickAdapter.notifyDataSetChanged();
                                                }
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });
                                } else {
//                                    showImageToas("请填写点内容吧");
                                }

                            }
                        });

                        /**
                         * 隐藏图片
                         */
                        MyNineGridView nineGridView = childView.findViewById(R.id.nineGrid);
                        nineGridView.setVisibility(View.GONE);

                        /**
                         * 内容
                         */
                        RichTextView content = childView.findViewById(R.id.content);
                        if (!TextUtils.isEmpty(item.getTitle())) {
                            content.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "no_img");
                                    bundle.putSerializable("data", item);
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(InvitationDetailActivity.class, bundle);
                                }
                            });
                            if (!item.getTitle().equals(content.getTag())) {
                                content.setTag(item.getTitle());
                                List<UserModel> list = new ArrayList<>();
                                if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    if (remindJsons != null) {
                                        for (int i = 0; i < remindJsons.size(); i++) {
                                            UserModel userModel = new UserModel();
                                            userModel.setUser_name(remindJsons.get(i).getNickname());
                                            userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                            list.add(userModel);
                                        }
                                    }
                                }

                                content.setVisibility(View.VISIBLE);

                                //直接使用RichTextView
                                content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                content.setLinkColor(Color.BLUE);
                                content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                //所有配置完成后才设置text
                                content.setRichTextUser(item.getTitle(), list);
                            }
                        } else {
                            content.setVisibility(View.GONE);
                        }

                        /**
                         * 位置
                         */
                        TextView location = childView.findViewById(R.id.location);
                        if (item.getIsTop() == 1) {
                            if ("1".equals(categoriesId)||"5".equals(categoriesId)) {
                                if (!TextUtils.isEmpty(item.getAddress())) {
                                    location.setText(item.getAddress().split("\\|")[0]);
                                    location.setTextColor(getResources().getColor(R.color.color_9999));
                                }
                            } else {
                                location.setText("置顶");
                                location.setTextColor(getResources().getColor(R.color.color_333));
                            }
                        } else {
                            if (!TextUtils.isEmpty(item.getAddress())) {
                                location.setText(item.getAddress().split("\\|")[0]);
                                location.setTextColor(getResources().getColor(R.color.color_9999));
                            }
                        }

                        /**
                         * 昵称
                         */
                        TextView name = childView.findViewById(R.id.name);
                        name.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getAnonymity() == 1) {
                                    showImageToas("匿名用户无法查看主页");
                                } else {
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(OtherInfoActivity.class, bundle);
                                }
                            }
                        });

                        /**
                         * 头像
                         */
                        CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                        /**
                         * 关注和点击事件
                         */
                        TextView follow = childView.findViewById(R.id.follow);

                        if (item.getAnonymity() == 1) {
                            Glide.with(context)
                                    .load("")
                                    .override(56, 56)
                                    .centerCrop()
                                    .dontAnimate()
                                    .placeholder(R.mipmap.head_anonymous_orange)
                                    .into(head_photo);

                            name.setText("匿名用户");

                            follow.setVisibility(View.INVISIBLE);
                        } else {
                            Glide.with(context)
                                    .load(item.getAvatar() + Config.IMAGE_LIM)
                                    .dontAnimate()
                                    .override(56, 56)
                                    .centerCrop()
                                    .error(R.mipmap.icon_no_head)
                                    .into(head_photo);

                            name.setText(item.getNickname());

                            if (mUserInfoBean != null) {
                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                    if (item.getIsAttention() == 1) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                    }
                                    follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            showDialog(context, "关注中...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(1);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });
                                }
                            } else {
                                if (item.getIsAttention() == 1) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                }
                                follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        showDialog(context, "关注中...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.getItem(i).setIsAttention(1);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });
                            }
                        }

                        /**
                         * 更多
                         */
                        LinearLayout more = childView.findViewById(R.id.more);
                        more.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getModule() == 4) {
                                    if (item.getIsAttention() != 1) {
                                        return;
                                    }
                                }
                                DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;

                                LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                LinearLayout report = dialog_more.findViewById(R.id.report);
                                LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                View line = dialog_more.findViewById(R.id.line);
                                View viewline = dialog_more.findViewById(R.id.view);
                                View view1 = dialog_more.findViewById(R.id.view1);

                                if (mUserInfoBean != null) {
                                    if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                        report.setVisibility(View.GONE);
                                        black_list.setVisibility(View.GONE);
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                        viewline.setVisibility(View.GONE);
                                        view1.setVisibility(View.INVISIBLE);
                                        delete.setVisibility(View.VISIBLE);
                                    } else {
                                        if (item.getIsAttention() == 1) {
                                            if (item.getAnonymity() == 1) {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            } else {
                                                cancel_follow.setVisibility(View.VISIBLE);
                                                line.setVisibility(View.VISIBLE);
                                            }
                                        } else {
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                        }
                                        viewline.setVisibility(View.VISIBLE);
                                        view1.setVisibility(View.INVISIBLE);
                                        report.setVisibility(View.VISIBLE);
                                        black_list.setVisibility(View.VISIBLE);
                                        delete.setVisibility(View.GONE);
                                    }
                                } else {
                                    cancel_follow.setVisibility(View.GONE);
                                    line.setVisibility(View.GONE);
                                }

                                delete.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "删除中...");
                                        HttpParams params = new HttpParams();
                                        params.put("contentId", item.getId());
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    quickAdapter.remove(item);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });

                                report.setOnClickListener(view19 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    DialogUtil.getInstance().dialog_center.dismiss();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "report");
                                    bundle.putString("contentId", item.getId() + "");
                                    bundle.putString("module", item.getModule() + "");
                                    bundle.putString("type", "1");
                                    bundle.putString("byUserId", item.getUserId() + "");
                                    startActivity(ReportActivity.class, bundle);
                                });

                                black_list.setOnClickListener(view110 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户不能屏蔽");
                                    } else {
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "屏蔽中...");
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.remove(i);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }

                                });

                                cancel_follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "取消关注...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if ("5".equals(categoriesId)) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.remove(i);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(0);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });

                            }
                        });


                        /**
                         *
                         * 跳转他人中心
                         */
                        RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                        head_photo_rl.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getAnonymity() == 1) {
                                    showImageToas("匿名用户无法查看主页");
                                } else {
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(OtherInfoActivity.class, bundle);
                                }
                            }
                        });


                        /**
                         * 分享
                         */
                        ImageView share = childView.findViewById(R.id.share);
                        share.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                contentId = item.getId();
                                showDialog(context, null);
                                JSONObject jsonObject = new JSONObject();
                                try {
                                    jsonObject.put("contentId", item.getId());
                                    jsonObject.put("module", 1);
                                } catch (JSONException e) {
                                    e.printStackTrace();
                                }
                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareDataBean>() {
                                    @Override
                                    public void onSuccess(ShareDataBean shareDataBean) {
                                        dismissDialog();
                                        if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                            showShareDialog(shareDataBean, 1);
                                        } else {
                                            if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                            } else {
                                                showImageToas(shareDataBean.getMsg());
                                            }
                                        }

                                    }

                                    @Override
                                    public void onError(Response<String> response) {
                                        super.onError(response);
                                        dismissDialog();
                                    }
                                });

                            }
                        });


                        /**
                         * 评论按钮点击事件跳转详情
                         */
                        ImageView comment = childView.findViewById(R.id.comment);
                        comment.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("flag", "no_img");
                                bundle.putSerializable("data", item);
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(InvitationDetailActivity.class, bundle);
                            }
                        });

                        /**
                         * 评论列表
                         */
                        XListView comment_listview = childView.findViewById(R.id.comment_listview);
                        TextView comment_count = childView.findViewById(R.id.comment_count);
                        if (item.getCommentSum() > 0) {
                            comment_count.setVisibility(View.VISIBLE);
                            comment_listview.setVisibility(View.VISIBLE);
                            comment_count.setText("共" + item.getCommentSum() + "条评论");

                            QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                    new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                        @Override
                                        protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                            TextView comment = helper_comment.getView(R.id.comment);

                                            comment.setOnClickListener(new View.OnClickListener() {
                                                @Override
                                                public void onClick(View view) {
                                                    if (Utils.isDoubleClick()) {
                                                        return;
                                                    }
                                                    Bundle bundle = new Bundle();
                                                    bundle.putString("flag", "no_img");
                                                    bundle.putSerializable("data", item);
                                                    bundle.putInt("position", helper.getPosition());
                                                    bundle.putString("categoriesId", categoriesId);
                                                    startActivity(InvitationDetailActivity.class, bundle);
                                                }
                                            });
                                            if (itemComment.getUserId() == item.getUserId()) {
                                                if (item.getAnonymity() == 1) {
                                                    SpannableString content = null;

                                                    content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                    comment.setText(content);
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                    comment.setText(content);
                                                }
                                            } else {
                                                SpannableString content = null;

                                                content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                if (itemComment.getWeight() == 1) {
                                                    content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                } else if (itemComment.getWeight() == -2) {
                                                    content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                } else {
                                                    content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                }
                                                content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                comment.setText(content);
                                            }

                                        }
                                    };
                            comment_listview.setAdapter(commentAdapter);
                        } else {
                            comment_count.setVisibility(View.GONE);
                            comment_listview.setVisibility(View.GONE);
                        }

                        /**
                         * 点赞接口
                         */
                        ImageView praise = childView.findViewById(R.id.praise);
                        if (item.getIsLike() == 1) {
                            praise.setImageResource(R.mipmap.icon_praise_select);
                        } else {
                            praise.setImageResource(R.mipmap.item_praise);
                        }
                        praise.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getIsLike() == 1) {
                                    praise.setEnabled(false);
                                    showDialog(context, "取消中...");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            praise.setEnabled(true);
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                item.setIsLike(0);
                                                item.setLikeSum(item.getLikeSum() - 1);
                                                quickAdapter.notifyDataSetChanged();
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                            praise.setEnabled(true);
                                        }
                                    });
                                } else {
                                    praise.setEnabled(false);
                                    showDialog(context, "点赞中...");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 1);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            praise.setEnabled(true);
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                item.setIsLike(1);
                                                item.setLikeSum(item.getLikeSum() + 1);
                                                quickAdapter.notifyDataSetChanged();
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                            praise.setEnabled(true);
                                        }
                                    });
                                }
                            }
                        });

                        /**
                         * 投票
                         */
                        XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                        if (item.getIsVote() == 0) {
                            vote_num_listview.setVisibility(View.GONE);
                        } else {
                            vote_num_listview.setVisibility(View.VISIBLE);
                            QuickAdapter<ContentVoteListBean> voteAdapter =
                                    new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                        @Override
                                        protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                            TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                            TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                            TextView vote_num = voteHelper.getView(R.id.vote_num);
                                            ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                            LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                            if (mUserInfoBean != null) {
                                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                    vote_tab_yes.setVisibility(View.VISIBLE);
                                                    vote_num.setVisibility(View.VISIBLE);
                                                    progressBar.setVisibility(View.VISIBLE);
                                                    vote_tab_no.setVisibility(View.INVISIBLE);

                                                    vote_tab_yes.setText(voteItem.getName());
                                                    vote_num.setText(voteItem.getVoteSum() + "票");

                                                    progressBar.setMax(item.getVoteTotal());
                                                    progressBar.setProgress(voteItem.getVoteSum());
                                                } else {
                                                    if (item.getIsVoted() == 1) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        vote_tab_yes.setVisibility(View.INVISIBLE);
                                                        vote_num.setVisibility(View.INVISIBLE);
                                                        progressBar.setVisibility(View.INVISIBLE);
                                                        vote_tab_no.setVisibility(View.VISIBLE);

                                                        vote_tab_no.setText(voteItem.getName());
                                                    }
                                                }
                                            } else {
                                                vote_tab_yes.setVisibility(View.INVISIBLE);
                                                vote_num.setVisibility(View.INVISIBLE);
                                                progressBar.setVisibility(View.INVISIBLE);
                                                vote_tab_no.setVisibility(View.VISIBLE);

                                                vote_tab_no.setText(voteItem.getName());
                                            }

                                            item_ll.setOnClickListener(new View.OnClickListener() {
                                                @Override
                                                public void onClick(View view) {
                                                    if (Utils.isDoubleClick()) {
                                                        return;
                                                    }
                                                    if (item.getIsVoted() == 1) {
                                                        if (voteItem.getIsVote() == 1) {
                                                            item_ll.setEnabled(false);
                                                            showDialog(context, "取消中...");
                                                            JSONObject jsonObject = new JSONObject();
                                                            try {
                                                                jsonObject.put("contentVoteId", voteItem.getId());
                                                                jsonObject.put("contentId", voteItem.getContentId());
                                                            } catch (JSONException e) {
                                                                e.printStackTrace();
                                                            }
                                                            finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                @Override
                                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                        item.setIsVoted(0);
                                                                        item.setVoteTotal(item.getVoteTotal() - 1);
                                                                        voteItem.setIsVote(0);
                                                                        voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                        notifyDataSetChanged();
                                                                    } else {
                                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                        } else {
//                                                                            showImageToas(sendCodeBean.getMsg());
                                                                        }
                                                                    }
                                                                }

                                                                @Override
                                                                public void onError(Response<String> response) {
                                                                    super.onError(response);
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                }
                                                            });
                                                        }
                                                    } else {
                                                        if (voteItem.getIsVote() == 0) {
                                                            item_ll.setEnabled(false);
                                                            showDialog(context, "投票中...");
                                                            JSONObject jsonObject = new JSONObject();
                                                            try {
                                                                jsonObject.put("contentId", voteItem.getContentId());
                                                                jsonObject.put("contentVoteId", voteItem.getId());
                                                            } catch (JSONException e) {
                                                                e.printStackTrace();
                                                            }
                                                            finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                @Override
                                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                        item.setIsVoted(1);
                                                                        item.setVoteTotal(item.getVoteTotal() + 1);
                                                                        voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                        voteItem.setIsVote(1);
                                                                        notifyDataSetChanged();
                                                                    } else {
                                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                        } else {
//                                                                            showImageToas(sendCodeBean.getMsg());
                                                                        }
                                                                    }
                                                                }

                                                                @Override
                                                                public void onError(Response<String> response) {
                                                                    super.onError(response);
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                }
                                                            });
                                                        }
                                                    }
                                                }
                                            });

                                        }
                                    };
                            vote_num_listview.setAdapter(voteAdapter);
                        }

                    }
                } else if (item.getModule() == 2 || item.getModule() == 4) {
                    /**
                     * 专栏和置顶
                     */
                    if (item.getType() == 1) {
                        /**
                         * 图片
                         */
                        container.removeAllViews();
                        View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_img, null, false);
                        container.addView(childView);

                        /**
                         * 点赞和评论数
                         */
                        TextView praise_tv = childView.findViewById(R.id.praise_tv);
                        praise_tv.setText(item.getLikeSum() + "");

                        TextView comment_tv = childView.findViewById(R.id.comment_tv);
                        comment_tv.setText(item.getCommentSum() + "");

                        /**
                         *时间
                         */
                        TextView time = childView.findViewById(R.id.time);
                        timecha(item.getCreateTime(), time);

                        /**
                         * 详情点击事件
                         */
                        LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                        item_ll.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("id", item.getId() + "");
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(FindDetailActivity.class, bundle);
                            }
                        });
                        item_ll.setTag(helper.getPosition());


                        /**
                         * 评论框
                         */
                        RelativeLayout comment_rl = childView.findViewById(R.id.comment_rl);
                        if (item.isShowEdit()) {
                            comment_rl.setVisibility(View.VISIBLE);
                        } else {
                            comment_rl.setVisibility(View.GONE);
                        }
                        EditText comment_et = childView.findViewById(R.id.comment_et);
                        if (mUserInfoBean != null) {
                            CircleImageView image = childView.findViewById(R.id.image);
                            Glide.with(context)
                                    .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                    .override(56, 56)
                                    .centerCrop()
                                    .error(R.mipmap.icon_no_head)
                                    .into(image);
                        }
                        childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                    showDialog(context, "评论中...");
                                    MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("comment", comment_et.getText().toString().trim());
                                        jsonObject.put("position", 1);
                                        jsonObject.put("type", 2);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                if (item.getCommentSum() < 2) {
                                                    item.setCommentSum(item.getCommentSum() + 1);
                                                    HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                    commentListBean.setComment(comment_et.getText().toString().trim());
                                                    commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                    item.getCommentList().add(commentListBean);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    item.setCommentSum(item.getCommentSum() + 1);
                                                    HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                    commentListBean.setComment(comment_et.getText().toString().trim());
                                                    commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                    item.getCommentList().set(0, commentListBean);
                                                    quickAdapter.notifyDataSetChanged();
                                                }
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });
                                } else {
//                                    showImageToas("请填写点内容吧");
                                }

                            }
                        });

                        /**
                         * 内容
                         */
                        RichTextView content = childView.findViewById(R.id.content);
                        if (!TextUtils.isEmpty(item.getTitle())) {
                            content.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("id", item.getId() + "");
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(FindDetailActivity.class, bundle);
                                }
                            });
                            if (!item.getTitle().equals(content.getTag())) {
                                content.setTag(item.getTitle());
                                List<UserModel> list = new ArrayList<>();
                                if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    if (remindJsons != null) {
                                        for (int i = 0; i < remindJsons.size(); i++) {
                                            UserModel userModel = new UserModel();
                                            userModel.setUser_name(remindJsons.get(i).getNickname());
                                            userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                            list.add(userModel);
                                        }
                                    }
                                }

                                content.setVisibility(View.VISIBLE);

                                //直接使用RichTextView
                                content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                content.setLinkColor(Color.BLUE);
                                content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                //所有配置完成后才设置text
                                content.setRichTextUser(item.getTitle(), list);
                            }
                        } else {
                            content.setVisibility(View.GONE);
                        }

                        /**
                         * 位置
                         */
                        TextView location = childView.findViewById(R.id.location);
                        location.setTextColor(getResources().getColor(R.color.color_333));
                        if (item.getModule() == 4) {
                            location.setText("置顶");
                        } else {
                            location.setText("发现");
                        }

                        /**
                         * 昵称
                         */
                        TextView name = childView.findViewById(R.id.name);
                        name.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("userId", item.getUserId() + "");
                                bundle.putString("userName", item.getNickname());
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(FindOtherInfoActivity.class, bundle);
                            }
                        });

                        /**
                         * 头像
                         */
                        CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                        /**
                         * 关注和点击事件
                         */
                        TextView follow = childView.findViewById(R.id.follow);

                        Glide.with(context)
                                .load(item.getAvatar() + Config.IMAGE_LIM)
                                .dontAnimate()
                                .override(56, 56)
                                .centerCrop()
                                .error(R.mipmap.icon_no_head)
                                .into(head_photo);

                        name.setText(item.getNickname());

                        if (mUserInfoBean != null) {
                            if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                follow.setVisibility(View.INVISIBLE);
                            } else {
                                follow.setVisibility(View.VISIBLE);
                                if (item.getIsAttention() == 1) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                }
                                follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        showDialog(context, "关注中...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.getItem(i).setIsAttention(1);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });
                            }
                        } else {
                            if (item.getIsAttention() == 1) {
                                follow.setVisibility(View.INVISIBLE);
                            } else {
                                follow.setVisibility(View.VISIBLE);
                            }
                            follow.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    showDialog(context, "关注中...");
                                    finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                    if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                        quickAdapter.getItem(i).setIsAttention(1);
                                                    }
                                                }
                                                quickAdapter.notifyDataSetChanged();
                                                EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });
                                }
                            });
                        }

                        /**
                         * 点赞接口
                         */
                        ImageView praise = childView.findViewById(R.id.praise);
                        if (item.getIsLike() == 1) {
                            praise.setImageResource(R.mipmap.icon_praise_select);
                        } else {
                            praise.setImageResource(R.mipmap.item_praise);
                        }
                        praise.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getIsLike() == 1) {
                                    praise.setEnabled(false);
                                    showDialog(context, "取消中...");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 2);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                item.setIsLike(0);
                                                item.setLikeSum(item.getLikeSum() - 1);
                                                quickAdapter.notifyDataSetChanged();
                                            } else {
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                            praise.setEnabled(true);
                                        }
                                    });
                                } else {
                                    praise.setEnabled(false);
                                    showDialog(context, "点赞中...");
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 2);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                        @Override
                                        public void onSuccess(SendCodeBean sendCodeBean) {
                                            dismissDialog();
                                            praise.setEnabled(true);
                                            if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                item.setIsLike(1);
                                                item.setLikeSum(item.getLikeSum() + 1);
                                                quickAdapter.notifyDataSetChanged();
                                            } else {
                                                if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(sendCodeBean.getMsg());
                                                }
                                            }
                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                            praise.setEnabled(true);
                                        }
                                    });
                                }
                            }
                        });

                        /**
                         * 更多
                         */
                        LinearLayout more = childView.findViewById(R.id.more);
                        more.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                if (item.getModule() == 4) {
                                    if (item.getIsAttention() != 1) {
                                        return;
                                    }
                                }
                                DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;

                                LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                LinearLayout report = dialog_more.findViewById(R.id.report);
                                LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                View line = dialog_more.findViewById(R.id.line);
                                View viewline = dialog_more.findViewById(R.id.view);
                                View view1 = dialog_more.findViewById(R.id.view1);

                                if (item.getModule() == 4) {
                                    if (item.getIsAttention() == 1) {
                                        if (item.getAnonymity() == 1) {
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                        } else {
                                            cancel_follow.setVisibility(View.VISIBLE);
                                            line.setVisibility(View.VISIBLE);
                                        }
                                    } else {
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                    }
                                    viewline.setVisibility(View.GONE);
                                    view1.setVisibility(View.GONE);
                                    report.setVisibility(View.GONE);
                                    black_list.setVisibility(View.GONE);
                                    delete.setVisibility(View.GONE);
                                } else {
                                    if (mUserInfoBean != null) {
                                        if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                            report.setVisibility(View.GONE);
                                            black_list.setVisibility(View.GONE);
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                            viewline.setVisibility(View.GONE);
                                            view1.setVisibility(View.INVISIBLE);
                                            delete.setVisibility(View.VISIBLE);
                                        } else {
                                            if (item.getIsAttention() == 1) {
                                                if (item.getAnonymity() == 1) {
                                                    cancel_follow.setVisibility(View.GONE);
                                                    line.setVisibility(View.GONE);
                                                } else {
                                                    cancel_follow.setVisibility(View.VISIBLE);
                                                    line.setVisibility(View.VISIBLE);
                                                }
                                            } else {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            }
                                            viewline.setVisibility(View.VISIBLE);
                                            view1.setVisibility(View.INVISIBLE);
                                            report.setVisibility(View.VISIBLE);
                                            black_list.setVisibility(View.VISIBLE);
                                            delete.setVisibility(View.GONE);
                                        }
                                    } else {
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                    }
                                }


                                delete.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "删除中...");
                                        HttpParams params = new HttpParams();
                                        params.put("contentId", item.getId());
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    quickAdapter.remove(item);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });

                                report.setOnClickListener(view19 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    DialogUtil.getInstance().dialog_center.dismiss();
                                    Bundle bundle = new Bundle();
                                    bundle.putString("flag", "report");
                                    bundle.putString("contentId", item.getId() + "");
                                    bundle.putString("module", item.getModule() + "");
                                    bundle.putString("type", "1");
                                    bundle.putString("byUserId", item.getUserId() + "");
                                    startActivity(ReportActivity.class, bundle);
                                });

                                black_list.setOnClickListener(view110 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getAnonymity() == 1) {
                                        showImageToas("匿名用户不能屏蔽");
                                    } else {
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "屏蔽中...");
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.remove(i);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }

                                });

                                cancel_follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "取消关注...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if ("5".equals(categoriesId)) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.remove(i);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(0);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });

                            }
                        });


                        /**
                         *
                         * 跳转他人中心
                         */
                        RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                        head_photo_rl.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("userId", item.getUserId() + "");
                                bundle.putString("userName", item.getNickname());
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(FindOtherInfoActivity.class, bundle);
                            }
                        });

                        /**
                         * 分享
                         */
                        ImageView share = childView.findViewById(R.id.share);
                        share.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                contentId = item.getId();
                                showDialog(context, null);
                                JSONObject jsonObject = new JSONObject();
                                try {
                                    jsonObject.put("contentId", item.getId());
                                    jsonObject.put("module", 2);
                                } catch (JSONException e) {
                                    e.printStackTrace();
                                }
                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareFindBean>() {
                                    @Override
                                    public void onSuccess(ShareFindBean shareDataBean) {
                                        dismissDialog();
                                        if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                            showFindShareDialog(shareDataBean, 2);
                                        } else {
                                            if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                            } else {
                                                showImageToas(shareDataBean.getMsg());
                                            }
                                        }

                                    }

                                    @Override
                                    public void onError(Response<String> response) {
                                        super.onError(response);
                                        dismissDialog();
                                    }
                                });

                            }
                        });


                        /**
                         * 评论按钮点击事件跳转详情
                         */
                        ImageView comment = childView.findViewById(R.id.comment);
                        comment.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putString("id", item.getId() + "");
                                bundle.putInt("position", helper.getPosition());
                                bundle.putString("categoriesId", categoriesId);
                                startActivity(FindDetailActivity.class, bundle);
                            }
                        });


                        /***
                         * 评论列表
                         */
                        XListView comment_listview = childView.findViewById(R.id.comment_listview);
                        TextView comment_count = childView.findViewById(R.id.comment_count);
                        if (item.getCommentSum() > 0) {
                            comment_count.setVisibility(View.VISIBLE);
                            comment_listview.setVisibility(View.VISIBLE);
                            comment_count.setText("共" + item.getCommentSum() + "条评论");

                            QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                    new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                        @Override
                                        protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                            TextView comment = helper_comment.getView(R.id.comment);

                                            comment.setOnClickListener(new View.OnClickListener() {
                                                @Override
                                                public void onClick(View view) {
                                                    if (Utils.isDoubleClick()) {
                                                        return;
                                                    }
                                                    Bundle bundle = new Bundle();
                                                    bundle.putString("id", item.getId() + "");
                                                    bundle.putInt("position", helper.getPosition());
                                                    bundle.putString("categoriesId", categoriesId);
                                                    startActivity(FindDetailActivity.class, bundle);
                                                }
                                            });
                                            if (itemComment.getUserId() == item.getUserId()) {
                                                if (item.getAnonymity() == 1) {
                                                    SpannableString content = null;

                                                    content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                    comment.setText(content);
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                    comment.setText(content);
                                                }
                                            } else {
                                                SpannableString content = null;

                                                content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                if (itemComment.getWeight() == 1) {
                                                    content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                } else if (itemComment.getWeight() == -2) {
                                                    content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                } else {
                                                    content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                }
                                                content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                comment.setText(content);
                                            }

                                        }
                                    };
                            comment_listview.setAdapter(commentAdapter);
                        } else {
                            comment_count.setVisibility(View.GONE);
                            comment_listview.setVisibility(View.GONE);
                        }

                        /**
                         * 图片展示
                         */
                        if (!TextUtils.isEmpty(item.getImage())) {
                            MyNineGridView nineGridView = childView.findViewById(R.id.nineGrid);
                            if (!item.getImage().equals(nineGridView.getTag())) {
                                nineGridView.setTag(item.getImage());
                                List<String> list = Arrays.asList(item.getImage().split("\\|"));
                                ArrayList<ImageInfo> imageInfo = new ArrayList<>();
                                for (int i = 0; i < list.size(); i++) {
                                    ImageInfo info = new ImageInfo();
                                    info.setThumbnailUrl(list.get(i) + Config.IMAGE_LIM);
                                    info.setBigImageUrl(list.get(i));
                                    imageInfo.add(info);
                                }
                                MyNineGridViewAdapter myNineGridViewAdapter = new MyNineGridViewAdapter(context, imageInfo);
                                myNineGridViewAdapter.setFind(true);
                                myNineGridViewAdapter.setonClickLisner(new OnImageClickListener() {
                                    @Override
                                    public void onClick() {
                                        Bundle bundle = new Bundle();
                                        bundle.putString("id", item.getId() + "");
                                        bundle.putInt("position", helper.getPosition());
                                        bundle.putString("categoriesId", categoriesId);
                                        startActivity(FindDetailActivity.class, bundle);
                                    }
                                });
                                nineGridView.setAdapter(myNineGridViewAdapter);
                            }
                        }

                        /**
                         * 投票
                         */
                        XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                        if (item.getIsVote() == 0) {
                            vote_num_listview.setVisibility(View.GONE);
                        } else {
                            vote_num_listview.setVisibility(View.VISIBLE);
                            QuickAdapter<ContentVoteListBean> voteAdapter =
                                    new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                        @Override
                                        protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                            TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                            TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                            TextView vote_num = voteHelper.getView(R.id.vote_num);
                                            ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                            LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                            if (mUserInfoBean != null) {
                                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                    vote_tab_yes.setVisibility(View.VISIBLE);
                                                    vote_num.setVisibility(View.VISIBLE);
                                                    progressBar.setVisibility(View.VISIBLE);
                                                    vote_tab_no.setVisibility(View.INVISIBLE);

                                                    vote_tab_yes.setText(voteItem.getName());
                                                    vote_num.setText(voteItem.getVoteSum() + "票");

                                                    progressBar.setMax(item.getVoteTotal());
                                                    progressBar.setProgress(voteItem.getVoteSum());
                                                } else {
                                                    if (item.getIsVoted() == 1) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        vote_tab_yes.setVisibility(View.INVISIBLE);
                                                        vote_num.setVisibility(View.INVISIBLE);
                                                        progressBar.setVisibility(View.INVISIBLE);
                                                        vote_tab_no.setVisibility(View.VISIBLE);

                                                        vote_tab_no.setText(voteItem.getName());
                                                    }
                                                }
                                            } else {
                                                vote_tab_yes.setVisibility(View.INVISIBLE);
                                                vote_num.setVisibility(View.INVISIBLE);
                                                progressBar.setVisibility(View.INVISIBLE);
                                                vote_tab_no.setVisibility(View.VISIBLE);

                                                vote_tab_no.setText(voteItem.getName());
                                            }


                                            item_ll.setOnClickListener(new View.OnClickListener() {
                                                @Override
                                                public void onClick(View view) {
                                                    if (Utils.isDoubleClick()) {
                                                        return;
                                                    }
                                                    if (item.getIsVoted() == 1) {
                                                        if (voteItem.getIsVote() == 1) {
                                                            item_ll.setEnabled(false);
                                                            showDialog(context, "取消中...");
                                                            JSONObject jsonObject = new JSONObject();
                                                            try {
                                                                jsonObject.put("contentVoteId", voteItem.getId());
                                                                jsonObject.put("contentId", voteItem.getContentId());
                                                            } catch (JSONException e) {
                                                                e.printStackTrace();
                                                            }
                                                            finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                @Override
                                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                        item.setIsVoted(0);
                                                                        item.setVoteTotal(item.getVoteTotal() - 1);
                                                                        voteItem.setIsVote(0);
                                                                        voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                        notifyDataSetChanged();
                                                                    } else {
                                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                        } else {
//                                                                            showImageToas(sendCodeBean.getMsg());
                                                                        }
                                                                    }
                                                                }

                                                                @Override
                                                                public void onError(Response<String> response) {
                                                                    super.onError(response);
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                }
                                                            });
                                                        }
                                                    } else {
                                                        if (voteItem.getIsVote() == 0) {
                                                            item_ll.setEnabled(false);
                                                            showDialog(context, "投票中...");
                                                            JSONObject jsonObject = new JSONObject();
                                                            try {
                                                                jsonObject.put("contentId", voteItem.getContentId());
                                                                jsonObject.put("contentVoteId", voteItem.getId());
                                                            } catch (JSONException e) {
                                                                e.printStackTrace();
                                                            }
                                                            finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                @Override
                                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                        item.setIsVoted(1);
                                                                        item.setVoteTotal(item.getVoteTotal() + 1);
                                                                        voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                        voteItem.setIsVote(1);
                                                                        notifyDataSetChanged();
                                                                    } else {
                                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                        } else {
//                                                                            showImageToas(sendCodeBean.getMsg());
                                                                        }
                                                                    }
                                                                }

                                                                @Override
                                                                public void onError(Response<String> response) {
                                                                    super.onError(response);
                                                                    dismissDialog();
                                                                    item_ll.setEnabled(true);
                                                                }
                                                            });
                                                        }
                                                    }
                                                }
                                            });

                                        }
                                    };
                            vote_num_listview.setAdapter(voteAdapter);
                        }
                    } else if (item.getType() == 2) {
                        if (item.getHeight() <= item.getWidth()) {
                            /**
                             * 4：3视频
                             */
                            container.removeAllViews();
                            View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_video_4_3, null, false);
                            container.addView(childView);

                            /**
                             * 点赞和评论数
                             */
                            TextView praise_tv = childView.findViewById(R.id.praise_tv);
                            praise_tv.setText(item.getLikeSum() + "");

                            TextView comment_tv = childView.findViewById(R.id.comment_tv);
                            comment_tv.setText(item.getCommentSum() + "");

                            /**
                             *时间
                             */
                            TextView time = childView.findViewById(R.id.time);
                            timecha(item.getCreateTime(), time);

                            /**
                             * 视频播放和点击事件
                             */
                            ScaleFrameLayout mcontainer = childView.findViewById(R.id.my_container);
                            VideoView myVideoView_4_3 = VideoHashMap.getIntance().get(item.getId());
                            mcontainer.removeAllViews();
                            removePlayerFormParent(myVideoView_4_3);

                            if (!TextUtils.isEmpty(item.getContent())) {
                                String playUrl = mPreloadManager.getPlayUrl(item.getContent());
                                myVideoView_4_3.setUrl(playUrl);
                                StandardVideoController controller1 = new StandardVideoController(context);
                                myVideoView_4_3.setVideoController(controller1);
                                controller1.setPlayState(myVideoView_4_3.getCurrentPlayState());
                                controller1.setPlayerState(myVideoView_4_3.getCurrentPlayerState());
                                Glide.with(context)
                                        .load(item.getContent() + "?vframe/jpg/offset/1")
                                        .crossFade()
                                        .placeholder(android.R.color.darker_gray)
                                        .into(controller1.getThumb());
                                myVideoView_4_3.setLooping(true);
                                myVideoView_4_3.setScreenScaleType(VideoView.SCREEN_SCALE_CENTER_CROP);
                                myVideoView_4_3.setMute(true);

                                controller1.getThumb().setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_4_3.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setModule(2);
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller1.findViewById(R.id.start_play).setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_4_3.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setModule(2);
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller1.setOnClickListener(view12 -> {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    myVideoView_4_3.setVideoController(null);
                                    Bundle bundle = new Bundle();
                                    VideoListBean videoListBean = new VideoListBean();
                                    videoListBean.setVideoDownloadUrl(item.getContent());
                                    videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                    videoListBean.setTitle(item.getTitle());
                                    videoListBean.setComment_num(item.getCommentSum());
                                    videoListBean.setPraise_num(item.getLikeSum());
                                    videoListBean.setHeadPhoto(item.getAvatar());
                                    videoListBean.setNickName(item.getNickname());
                                    videoListBean.setTime(item.getCreateTime());
                                    videoListBean.setIsLike(item.getIsLike());
                                    videoListBean.setAnonymity(item.getAnonymity());
                                    videoListBean.setUserId(item.getUserId());
                                    videoListBean.setModule(2);
                                    videoListBean.setContentId(item.getId());
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    videoListBean.setList(remindJsons);
                                    bundle.putSerializable("data", videoListBean);
                                    bundle.putInt("videoId", item.getId());
                                    bundle.putString("categoriesId", categoriesId);
                                    bundle.putString("flag", "recommend");
                                    bundle.putInt("position", helper.getPosition());
                                    startActivity(VideoDetailActivity.class, bundle);
                                });
                            }

                            mcontainer.addView(myVideoView_4_3);

                            /**
                             * 详情页点击事件
                             */
                            LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                            item_ll.setOnClickListener(view13 -> {
                                if (Utils.isDoubleClick()) {
                                    return;
                                }
                                currentPlayPosition = item.getId();
                                myVideoView_4_3.setVideoController(null);
                                Bundle bundle = new Bundle();
                                VideoListBean videoListBean = new VideoListBean();
                                videoListBean.setVideoDownloadUrl(item.getContent());
                                videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                videoListBean.setTitle(item.getTitle());
                                videoListBean.setComment_num(item.getCommentSum());
                                videoListBean.setPraise_num(item.getLikeSum());
                                videoListBean.setHeadPhoto(item.getAvatar());
                                videoListBean.setNickName(item.getNickname());
                                videoListBean.setTime(item.getCreateTime());
                                videoListBean.setIsLike(item.getIsLike());
                                videoListBean.setAnonymity(item.getAnonymity());
                                videoListBean.setUserId(item.getUserId());
                                videoListBean.setModule(2);
                                videoListBean.setContentId(item.getId());
                                List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                videoListBean.setList(remindJsons);
                                bundle.putSerializable("data", videoListBean);
                                bundle.putInt("videoId", item.getId());
                                bundle.putString("categoriesId", categoriesId);
                                bundle.putString("flag", "recommend");
                                bundle.putInt("position", helper.getPosition());
                                startActivity(VideoDetailActivity.class, bundle);
                            });
                            item_ll.setTag(helper.getPosition());

                            /**
                             * 评论按钮点击事件跳转详情页
                             */
                            ImageView comment = childView.findViewById(R.id.comment);
                            comment.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    myVideoView_4_3.setVideoController(null);
                                    Bundle bundle = new Bundle();
                                    VideoListBean videoListBean = new VideoListBean();
                                    videoListBean.setVideoDownloadUrl(item.getContent());
                                    videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                    videoListBean.setTitle(item.getTitle());
                                    videoListBean.setComment_num(item.getCommentSum());
                                    videoListBean.setPraise_num(item.getLikeSum());
                                    videoListBean.setHeadPhoto(item.getAvatar());
                                    videoListBean.setNickName(item.getNickname());
                                    videoListBean.setTime(item.getCreateTime());
                                    videoListBean.setIsLike(item.getIsLike());
                                    videoListBean.setAnonymity(item.getAnonymity());
                                    videoListBean.setUserId(item.getUserId());
                                    videoListBean.setContentId(item.getId());
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    videoListBean.setList(remindJsons);
                                    videoListBean.setModule(2);
                                    bundle.putSerializable("data", videoListBean);
                                    bundle.putInt("videoId", item.getId());
                                    bundle.putString("categoriesId", categoriesId);
                                    bundle.putString("flag", "recommend");
                                    bundle.putInt("position", helper.getPosition());
                                    startActivity(VideoDetailActivity.class, bundle);
                                }
                            });

                            /**
                             * 自动弹出评论框后 发送评论
                             */
                            EditText comment_et = childView.findViewById(R.id.comment_et);
                            if (mUserInfoBean != null) {
                                CircleImageView image = childView.findViewById(R.id.image);
                                Glide.with(context)
                                        .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                        .override(56, 56)
                                        .centerCrop()
                                        .error(R.mipmap.icon_no_head)
                                        .into(image);
                            }
                            childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                        showDialog(context, "评论中...");
                                        MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("comment", comment_et.getText().toString().trim());
                                            jsonObject.put("position", 1);
                                            jsonObject.put("type", 2);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if (item.getCommentSum() < 2) {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().add(commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().set(0, commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    } else {
//                                        showImageToas("请填写点内容吧");
                                    }

                                }
                            });

                            /**
                             * 内容
                             */
                            RichTextView content = childView.findViewById(R.id.content);
                            if (!TextUtils.isEmpty(item.getTitle())) {
                                content.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_4_3.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setModule(2);
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });
                                if (!item.getTitle().equals(content.getTag())) {
                                    content.setTag(item.getTitle());
                                    List<UserModel> list = new ArrayList<>();
                                    if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        if (remindJsons != null) {
                                            for (int i = 0; i < remindJsons.size(); i++) {
                                                UserModel userModel = new UserModel();
                                                userModel.setUser_name(remindJsons.get(i).getNickname());
                                                userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                                list.add(userModel);
                                            }
                                        }
                                    }

                                    content.setVisibility(View.VISIBLE);

                                    //直接使用RichTextView
                                    content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                    content.setLinkColor(Color.BLUE);
                                    content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                    //所有配置完成后才设置text
                                    content.setRichTextUser(item.getTitle(), list);
                                }
                            } else {
                                content.setVisibility(View.GONE);
                            }

                            /**
                             * 位置
                             */
                            TextView location = childView.findViewById(R.id.location);
                            location.setTextColor(getResources().getColor(R.color.color_333));
                            if (item.getModule() == 4) {
                                location.setText("置顶");
                            } else {
                                location.setText("发现");
                            }

                            /**
                             * 昵称
                             */
                            TextView name = childView.findViewById(R.id.name);
                            name.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(FindOtherInfoActivity.class, bundle);
                                }
                            });

                            /**
                             * 头像
                             */
                            CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                            /**
                             * 关注和点击事件
                             */
                            TextView follow = childView.findViewById(R.id.follow);

                            Glide.with(context)
                                    .load(item.getAvatar() + Config.IMAGE_LIM)
                                    .dontAnimate()
                                    .override(56, 56)
                                    .centerCrop()
                                    .error(R.mipmap.icon_no_head)
                                    .into(head_photo);

                            name.setText(item.getNickname());

                            if (mUserInfoBean != null) {
                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                    if (item.getIsAttention() == 1) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                    }
                                    follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            showDialog(context, "关注中...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(1);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });
                                }
                            } else {
                                if (item.getIsAttention() == 1) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                }
                                follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        showDialog(context, "关注中...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.getItem(i).setIsAttention(1);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });
                            }

                            /**
                             * 点赞接口
                             */
                            ImageView praise = childView.findViewById(R.id.praise);
                            if (item.getIsLike() == 1) {
                                praise.setImageResource(R.mipmap.icon_praise_select);
                            } else {
                                praise.setImageResource(R.mipmap.item_praise);
                            }
                            praise.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getIsLike() == 1) {
                                        praise.setEnabled(false);
                                        showDialog(context, "取消中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 2);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(0);
                                                    item.setLikeSum(item.getLikeSum() - 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    } else {
                                        praise.setEnabled(false);
                                        showDialog(context, "点赞中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 2);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(1);
                                                    item.setLikeSum(item.getLikeSum() + 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    }
                                }
                            });

                            /**
                             * 更多
                             */
                            LinearLayout more = childView.findViewById(R.id.more);
                            more.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getModule() == 4) {
                                        if (item.getIsAttention() != 1) {
                                            return;
                                        }
                                    }
                                    DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                    LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;

                                    LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                    LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                    LinearLayout report = dialog_more.findViewById(R.id.report);
                                    LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                    View line = dialog_more.findViewById(R.id.line);
                                    View viewline = dialog_more.findViewById(R.id.view);
                                    View view1 = dialog_more.findViewById(R.id.view1);

                                    if (mUserInfoBean != null) {
                                        if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                            report.setVisibility(View.GONE);
                                            black_list.setVisibility(View.GONE);
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                            viewline.setVisibility(View.GONE);
                                            view1.setVisibility(View.INVISIBLE);
                                            delete.setVisibility(View.VISIBLE);
                                        } else {
                                            if (item.getIsAttention() == 1) {
                                                if (item.getAnonymity() == 1) {
                                                    cancel_follow.setVisibility(View.GONE);
                                                    line.setVisibility(View.GONE);
                                                } else {
                                                    cancel_follow.setVisibility(View.VISIBLE);
                                                    line.setVisibility(View.VISIBLE);
                                                }
                                            } else {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            }
                                            viewline.setVisibility(View.VISIBLE);
                                            view1.setVisibility(View.INVISIBLE);
                                            report.setVisibility(View.VISIBLE);
                                            black_list.setVisibility(View.VISIBLE);
                                            delete.setVisibility(View.GONE);
                                        }
                                    } else {
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                    }

                                    delete.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "删除中...");
                                            HttpParams params = new HttpParams();
                                            params.put("contentId", item.getId());
                                            finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        quickAdapter.remove(item);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                    report.setOnClickListener(view19 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        Bundle bundle = new Bundle();
                                        bundle.putString("flag", "report");
                                        bundle.putString("contentId", item.getId() + "");
                                        bundle.putString("module", item.getModule() + "");
                                        bundle.putString("type", "1");
                                        bundle.putString("byUserId", item.getUserId() + "");
                                        startActivity(ReportActivity.class, bundle);
                                    });

                                    black_list.setOnClickListener(view110 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "屏蔽中...");
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.remove(i);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });

                                    });


                                    cancel_follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "取消关注...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        if ("5".equals(categoriesId)) {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.remove(i);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        } else {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.getItem(i).setIsAttention(0);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        }
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                }
                            });

                            /**
                             *
                             * 跳转他人中心
                             */
                            RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                            head_photo_rl.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(FindOtherInfoActivity.class, bundle);
                                }
                            });


                            /**
                             * 分享
                             */
                            ImageView share = childView.findViewById(R.id.share);
                            share.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    contentId = item.getId();
                                    showDialog(context, null);
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 2);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareFindBean>() {
                                        @Override
                                        public void onSuccess(ShareFindBean shareDataBean) {
                                            dismissDialog();
                                            if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                                showFindShareDialog(shareDataBean, 2);
                                            } else {
                                                if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(shareDataBean.getMsg());
                                                }
                                            }

                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });

                                }
                            });


                            /**
                             * 评论列表
                             */
                            XListView comment_listview = childView.findViewById(R.id.comment_listview);
                            TextView comment_count = childView.findViewById(R.id.comment_count);
                            if (item.getCommentSum() > 0) {
                                comment_count.setVisibility(View.VISIBLE);
                                comment_listview.setVisibility(View.VISIBLE);
                                comment_count.setText("共" + item.getCommentSum() + "条评论");

                                QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                        new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                                TextView comment = helper_comment.getView(R.id.comment);

                                                comment.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        currentPlayPosition = item.getId();
                                                        myVideoView_4_3.setVideoController(null);
                                                        Bundle bundle = new Bundle();
                                                        VideoListBean videoListBean = new VideoListBean();
                                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                                        videoListBean.setTitle(item.getTitle());
                                                        videoListBean.setComment_num(item.getCommentSum());
                                                        videoListBean.setPraise_num(item.getLikeSum());
                                                        videoListBean.setHeadPhoto(item.getAvatar());
                                                        videoListBean.setNickName(item.getNickname());
                                                        videoListBean.setTime(item.getCreateTime());
                                                        videoListBean.setIsLike(item.getIsLike());
                                                        videoListBean.setAnonymity(item.getAnonymity());
                                                        videoListBean.setUserId(item.getUserId());
                                                        videoListBean.setContentId(item.getId());
                                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                                        videoListBean.setList(remindJsons);
                                                        videoListBean.setModule(2);
                                                        bundle.putSerializable("data", videoListBean);
                                                        bundle.putInt("videoId", item.getId());
                                                        bundle.putString("categoriesId", categoriesId);
                                                        bundle.putString("flag", "recommend");
                                                        bundle.putInt("position", helper.getPosition());
                                                        startActivity(VideoDetailActivity.class, bundle);
                                                    }
                                                });
                                                if (itemComment.getUserId() == item.getUserId()) {
                                                    if (item.getAnonymity() == 1) {
                                                        SpannableString content = null;

                                                        content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    } else {
                                                        SpannableString content = null;

                                                        content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    }
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                    comment.setText(content);
                                                }
                                            }
                                        };
                                comment_listview.setAdapter(commentAdapter);
                            } else {
                                comment_count.setVisibility(View.GONE);
                                comment_listview.setVisibility(View.GONE);
                            }

                            /**
                             * 投票
                             */
                            XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                            if (item.getIsVote() == 0) {
                                vote_num_listview.setVisibility(View.GONE);
                            } else {
                                vote_num_listview.setVisibility(View.VISIBLE);
                                QuickAdapter<ContentVoteListBean> voteAdapter =
                                        new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                                TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                                TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                                TextView vote_num = voteHelper.getView(R.id.vote_num);
                                                ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                                LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                                if (mUserInfoBean != null) {
                                                    if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        if (item.getIsVoted() == 1) {
                                                            vote_tab_yes.setVisibility(View.VISIBLE);
                                                            vote_num.setVisibility(View.VISIBLE);
                                                            progressBar.setVisibility(View.VISIBLE);
                                                            vote_tab_no.setVisibility(View.INVISIBLE);

                                                            vote_tab_yes.setText(voteItem.getName());
                                                            vote_num.setText(voteItem.getVoteSum() + "票");

                                                            progressBar.setMax(item.getVoteTotal());
                                                            progressBar.setProgress(voteItem.getVoteSum());
                                                        } else {
                                                            vote_tab_yes.setVisibility(View.INVISIBLE);
                                                            vote_num.setVisibility(View.INVISIBLE);
                                                            progressBar.setVisibility(View.INVISIBLE);
                                                            vote_tab_no.setVisibility(View.VISIBLE);

                                                            vote_tab_no.setText(voteItem.getName());
                                                        }
                                                    }
                                                } else {
                                                    vote_tab_yes.setVisibility(View.INVISIBLE);
                                                    vote_num.setVisibility(View.INVISIBLE);
                                                    progressBar.setVisibility(View.INVISIBLE);
                                                    vote_tab_no.setVisibility(View.VISIBLE);

                                                    vote_tab_no.setText(voteItem.getName());
                                                }
                                                item_ll.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        if (item.getIsVoted() == 1) {
                                                            if (voteItem.getIsVote() == 1) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "取消中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(0);
                                                                            item.setVoteTotal(item.getVoteTotal() - 1);
                                                                            voteItem.setIsVote(0);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        } else {
                                                            if (voteItem.getIsVote() == 0) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "投票中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(1);
                                                                            item.setVoteTotal(item.getVoteTotal() + 1);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                            voteItem.setIsVote(1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        }
                                                    }
                                                });

                                            }
                                        };
                                vote_num_listview.setAdapter(voteAdapter);
                            }

                        } else {
                            /**
                             * 3：2视频
                             */
                            container.removeAllViews();
                            View childView = LayoutInflater.from(context).inflate(R.layout.item_recommend_video_3_2, null, false);
                            container.addView(childView);

                            /**
                             * 点赞和评论数
                             */
                            TextView praise_tv = childView.findViewById(R.id.praise_tv);
                            praise_tv.setText(item.getLikeSum() + "");

                            TextView comment_tv = childView.findViewById(R.id.comment_tv);
                            comment_tv.setText(item.getCommentSum() + "");

                            /**
                             *时间
                             */
                            TextView time = childView.findViewById(R.id.time);
                            timecha(item.getCreateTime(), time);

                            /**
                             * 视频播放和点击事件
                             */
                            ScaleFrameLayout mcontainer = childView.findViewById(R.id.my_container);
                            VideoView myVideoView_3_2 = VideoHashMap.getIntance().get(item.getId());
                            mcontainer.removeAllViews();
                            removePlayerFormParent(myVideoView_3_2);

                            if (!TextUtils.isEmpty(item.getContent())) {
                                String playUrl = mPreloadManager.getPlayUrl(item.getContent());
                                myVideoView_3_2.setUrl(playUrl);
                                StandardVideoController controller = new StandardVideoController(context);
                                myVideoView_3_2.setVideoController(controller);
                                controller.setPlayState(myVideoView_3_2.getCurrentPlayState());
                                controller.setPlayerState(myVideoView_3_2.getCurrentPlayerState());
                                Glide.with(context)
                                        .load(item.getContent() + "?vframe/jpg/offset/1")
                                        .crossFade()
                                        .placeholder(android.R.color.darker_gray)
                                        .into(controller.getThumb());
                                myVideoView_3_2.setLooping(true);
                                myVideoView_3_2.setScreenScaleType(VideoView.SCREEN_SCALE_CENTER_CROP);
                                myVideoView_3_2.setMute(true);

                                controller.getThumb().setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setModule(2);
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller.findViewById(R.id.start_play).setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setModule(2);
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });

                                controller.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setModule(2);
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        videoListBean.setContentId(item.getId());
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });
                            }

                            mcontainer.addView(myVideoView_3_2);

                            /**
                             * 详情点击事件
                             */
                            LinearLayout item_ll = childView.findViewById(R.id.item_ll);
                            item_ll.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    currentPlayPosition = item.getId();
                                    myVideoView_3_2.setVideoController(null);
                                    Bundle bundle = new Bundle();
                                    VideoListBean videoListBean = new VideoListBean();
                                    videoListBean.setVideoDownloadUrl(item.getContent());
                                    videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                    videoListBean.setTitle(item.getTitle());
                                    videoListBean.setComment_num(item.getCommentSum());
                                    videoListBean.setPraise_num(item.getLikeSum());
                                    videoListBean.setHeadPhoto(item.getAvatar());
                                    videoListBean.setNickName(item.getNickname());
                                    videoListBean.setTime(item.getCreateTime());
                                    videoListBean.setIsLike(item.getIsLike());
                                    videoListBean.setAnonymity(item.getAnonymity());
                                    videoListBean.setUserId(item.getUserId());
                                    videoListBean.setContentId(item.getId());
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    videoListBean.setList(remindJsons);
                                    videoListBean.setModule(2);
                                    bundle.putSerializable("data", videoListBean);
                                    bundle.putInt("videoId", item.getId());
                                    bundle.putString("categoriesId", categoriesId);
                                    bundle.putString("flag", "recommend");
                                    bundle.putInt("position", helper.getPosition());
                                    startActivity(VideoDetailActivity.class, bundle);
                                }
                            });
                            item_ll.setTag(helper.getPosition());

                            /**
                             * 评论框
                             */
                            RelativeLayout comment_rl = childView.findViewById(R.id.comment_rl);
                            if (item.isShowEdit()) {
                                comment_rl.setVisibility(View.VISIBLE);
                            } else {
                                comment_rl.setVisibility(View.GONE);
                            }
                            EditText comment_et = childView.findViewById(R.id.comment_et);
                            if (mUserInfoBean != null) {
                                CircleImageView image = childView.findViewById(R.id.image);
                                Glide.with(context)
                                        .load(mUserInfoBean.getUser().getAvatar() + Config.IMAGE_LIM)
                                        .override(56, 56)
                                        .centerCrop()
                                        .error(R.mipmap.icon_no_head)
                                        .into(image);
                            }
                            childView.findViewById(R.id.send).setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (!TextUtils.isEmpty(comment_et.getText().toString().trim())) {
                                        showDialog(context, "评论中...");
                                        MobclickAgent.onEvent(ContextUtil.getContext(), "commentID");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("comment", comment_et.getText().toString().trim());
                                            jsonObject.put("position", 1);
                                            jsonObject.put("type", 2);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.COMMENT_SAVE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    if (item.getCommentSum() < 2) {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().add(commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        item.setCommentSum(item.getCommentSum() + 1);
                                                        HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                                                        commentListBean.setComment(comment_et.getText().toString().trim());
                                                        commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                                                        item.getCommentList().set(0, commentListBean);
                                                        quickAdapter.notifyDataSetChanged();
                                                    }
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    } else {
//                                        showImageToas("请填写点内容吧");
                                    }

                                }
                            });

                            /**
                             * 内容
                             */
                            RichTextView content = childView.findViewById(R.id.content);
                            if (!TextUtils.isEmpty(item.getTitle())) {
                                content.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        currentPlayPosition = item.getId();
                                        myVideoView_3_2.setVideoController(null);
                                        Bundle bundle = new Bundle();
                                        VideoListBean videoListBean = new VideoListBean();
                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                        videoListBean.setTitle(item.getTitle());
                                        videoListBean.setComment_num(item.getCommentSum());
                                        videoListBean.setPraise_num(item.getLikeSum());
                                        videoListBean.setHeadPhoto(item.getAvatar());
                                        videoListBean.setNickName(item.getNickname());
                                        videoListBean.setTime(item.getCreateTime());
                                        videoListBean.setIsLike(item.getIsLike());
                                        videoListBean.setAnonymity(item.getAnonymity());
                                        videoListBean.setUserId(item.getUserId());
                                        videoListBean.setContentId(item.getId());
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        videoListBean.setList(remindJsons);
                                        videoListBean.setModule(2);
                                        bundle.putSerializable("data", videoListBean);
                                        bundle.putInt("videoId", item.getId());
                                        bundle.putString("categoriesId", categoriesId);
                                        bundle.putString("flag", "recommend");
                                        bundle.putInt("position", helper.getPosition());
                                        startActivity(VideoDetailActivity.class, bundle);
                                    }
                                });
                                if (!item.getTitle().equals(content.getTag())) {
                                    content.setTag(item.getTitle());
                                    List<UserModel> list = new ArrayList<>();
                                    if (!TextUtils.isEmpty(item.getRemindJson()) && !"[]".equals(item.getRemindJson())) {
                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                        if (remindJsons != null) {
                                            for (int i = 0; i < remindJsons.size(); i++) {
                                                UserModel userModel = new UserModel();
                                                userModel.setUser_name(remindJsons.get(i).getNickname());
                                                userModel.setUser_id(remindJsons.get(i).getUserId() + "");
                                                list.add(userModel);
                                            }
                                        }
                                    }

                                    content.setVisibility(View.VISIBLE);

                                    //直接使用RichTextView
                                    content.setAtColor(Color.parseColor(getString(R.string.remind_color)));
                                    content.setLinkColor(Color.BLUE);
                                    content.setSpanAtUserCallBackListener(spanAtUserCallBack);
                                    //所有配置完成后才设置text
                                    content.setRichTextUser(item.getTitle(), list);
                                }
                            } else {
                                content.setVisibility(View.GONE);
                            }

                            /**
                             * 位置
                             */
                            TextView location = childView.findViewById(R.id.location);
                            location.setTextColor(getResources().getColor(R.color.color_333));
                            if (item.getModule() == 4) {
                                location.setText("置顶");
                            } else {
                                location.setText("发现");
                            }

                            /**
                             * 昵称
                             */
                            TextView name = childView.findViewById(R.id.name);
                            name.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(FindOtherInfoActivity.class, bundle);
                                }
                            });

                            /**
                             *
                             * 跳转他人中心
                             */
                            RelativeLayout head_photo_rl = childView.findViewById(R.id.head_photo_rl);
                            head_photo_rl.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    Bundle bundle = new Bundle();
                                    bundle.putString("userId", item.getUserId() + "");
                                    bundle.putString("userName", item.getNickname());
                                    bundle.putInt("position", helper.getPosition());
                                    bundle.putString("categoriesId", categoriesId);
                                    startActivity(FindOtherInfoActivity.class, bundle);
                                }
                            });

                            /**
                             * 头像
                             */
                            CircleImageView head_photo = childView.findViewById(R.id.head_photo);
                            /**
                             * 关注和点击事件
                             */
                            TextView follow = childView.findViewById(R.id.follow);

                            Glide.with(context)
                                    .load(item.getAvatar() + Config.IMAGE_LIM)
                                    .override(56, 56)
                                    .centerCrop()
                                    .dontAnimate()
                                    .error(R.mipmap.icon_no_head)
                                    .into(head_photo);

                            name.setText(item.getNickname());

                            if (mUserInfoBean != null) {
                                if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                    if (item.getIsAttention() == 1) {
                                        follow.setVisibility(View.INVISIBLE);
                                    } else {
                                        follow.setVisibility(View.VISIBLE);
                                    }
                                    follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            showDialog(context, "关注中...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                            if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                quickAdapter.getItem(i).setIsAttention(1);
                                                            }
                                                        }
                                                        quickAdapter.notifyDataSetChanged();
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });
                                }
                            } else {
                                if (item.getIsAttention() == 1) {
                                    follow.setVisibility(View.INVISIBLE);
                                } else {
                                    follow.setVisibility(View.VISIBLE);
                                }
                                follow.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        showDialog(context, "关注中...");
                                        finalOkGo.requestHead(RequestType.GETHEAD, Url.FOLLOW_OTHER + item.getUserId(), null, Url.FOLLOW_OTHER, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.getItem(i).setIsAttention(1);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });
                                    }
                                });
                            }

                            /**
                             * 点赞接口
                             */
                            ImageView praise = childView.findViewById(R.id.praise);
                            if (item.getIsLike() == 1) {
                                praise.setImageResource(R.mipmap.icon_praise_select);
                            } else {
                                praise.setImageResource(R.mipmap.item_praise);
                            }
                            praise.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getIsLike() == 1) {
                                        praise.setEnabled(false);
                                        showDialog(context, "取消中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 2);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCEL_PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(0);
                                                    item.setLikeSum(item.getLikeSum() - 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    } else {
                                        praise.setEnabled(false);
                                        showDialog(context, "点赞中...");
                                        JSONObject jsonObject = new JSONObject();
                                        try {
                                            jsonObject.put("contentId", item.getId());
                                            jsonObject.put("module", 2);
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.PRAISE_HOME, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                praise.setEnabled(true);
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    item.setIsLike(1);
                                                    item.setLikeSum(item.getLikeSum() + 1);
                                                    quickAdapter.notifyDataSetChanged();
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                                praise.setEnabled(true);
                                            }
                                        });
                                    }
                                }
                            });

                            /**
                             * 更多
                             */
                            LinearLayout more = childView.findViewById(R.id.more);
                            more.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    if (item.getModule() == 4) {
                                        if (item.getIsAttention() != 1) {
                                            return;
                                        }
                                    }
                                    DialogUtil.getInstance().showCenterDialog(context, R.layout.dialog_more);
                                    LinearLayout dialog_more = (LinearLayout) DialogUtil.getInstance().dialog_center_layout;

                                    LinearLayout cancel_follow = dialog_more.findViewById(R.id.cancel_follow);
                                    LinearLayout delete = dialog_more.findViewById(R.id.delete);
                                    LinearLayout report = dialog_more.findViewById(R.id.report);
                                    LinearLayout black_list = dialog_more.findViewById(R.id.black_list);

                                    View line = dialog_more.findViewById(R.id.line);
                                    View viewline = dialog_more.findViewById(R.id.view);
                                    View view1 = dialog_more.findViewById(R.id.view1);

                                    if (mUserInfoBean != null) {
                                        if (mUserInfoBean.getUser().getUserId() == item.getUserId()) {
                                            report.setVisibility(View.GONE);
                                            black_list.setVisibility(View.GONE);
                                            cancel_follow.setVisibility(View.GONE);
                                            line.setVisibility(View.GONE);
                                            viewline.setVisibility(View.GONE);
                                            view1.setVisibility(View.INVISIBLE);
                                            delete.setVisibility(View.VISIBLE);
                                        } else {
                                            if (item.getIsAttention() == 1) {
                                                if (item.getAnonymity() == 1) {
                                                    cancel_follow.setVisibility(View.GONE);
                                                    line.setVisibility(View.GONE);
                                                } else {
                                                    cancel_follow.setVisibility(View.VISIBLE);
                                                    line.setVisibility(View.VISIBLE);
                                                }
                                            } else {
                                                cancel_follow.setVisibility(View.GONE);
                                                line.setVisibility(View.GONE);
                                            }
                                            viewline.setVisibility(View.VISIBLE);
                                            view1.setVisibility(View.INVISIBLE);
                                            report.setVisibility(View.VISIBLE);
                                            black_list.setVisibility(View.VISIBLE);
                                            delete.setVisibility(View.GONE);
                                        }
                                    } else {
                                        cancel_follow.setVisibility(View.GONE);
                                        line.setVisibility(View.GONE);
                                    }

                                    delete.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "删除中...");
                                            HttpParams params = new HttpParams();
                                            params.put("contentId", item.getId());
                                            finalOkGo.requestHead(RequestType.POSTHEAD, Url.DELETE_CONTENT, params, Url.DELETE_CONTENT, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        quickAdapter.remove(item);
                                                        quickAdapter.notifyDataSetChanged();
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                    report.setOnClickListener(view19 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        Bundle bundle = new Bundle();
                                        bundle.putString("flag", "report");
                                        bundle.putString("contentId", item.getId() + "");
                                        bundle.putString("module", item.getModule() + "");
                                        bundle.putString("type", "1");
                                        bundle.putString("byUserId", item.getUserId() + "");
                                        startActivity(ReportActivity.class, bundle);
                                    });

                                    black_list.setOnClickListener(view110 -> {
                                        if (Utils.isDoubleClick()) {
                                            return;
                                        }
                                        DialogUtil.getInstance().dialog_center.dismiss();
                                        showDialog(context, "屏蔽中...");
                                        finalOkGo.requestHead(RequestType.POSTHEAD, Url.ADD_BLACK_LIST + item.getUserId(), null, Url.ADD_BLACK_LIST, new Callback<SendCodeBean>() {
                                            @Override
                                            public void onSuccess(SendCodeBean sendCodeBean) {
                                                dismissDialog();
                                                if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                    for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                        if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                            quickAdapter.remove(i);
                                                        }
                                                    }
                                                    quickAdapter.notifyDataSetChanged();
                                                    EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                } else {
                                                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                    } else {
                                                        showImageToas(sendCodeBean.getMsg());
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Response<String> response) {
                                                super.onError(response);
                                                dismissDialog();
                                            }
                                        });

                                    });


                                    cancel_follow.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public void onClick(View view) {
                                            if (Utils.isDoubleClick()) {
                                                return;
                                            }
                                            DialogUtil.getInstance().dialog_center.dismiss();
                                            showDialog(context, "取消关注...");
                                            finalOkGo.requestHead(RequestType.GETHEAD, Url.CANCEL_FOLLOW + item.getUserId(), null, Url.CANCEL_FOLLOW, new Callback<SendCodeBean>() {
                                                @Override
                                                public void onSuccess(SendCodeBean sendCodeBean) {
                                                    dismissDialog();
                                                    if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                        if ("5".equals(categoriesId)) {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.remove(i);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        } else {
                                                            for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                                                                if (item.getUserId() == quickAdapter.getItem(i).getUserId()) {
                                                                    quickAdapter.getItem(i).setIsAttention(0);
                                                                }
                                                            }
                                                            quickAdapter.notifyDataSetChanged();
                                                        }
                                                        EventBus.getDefault().post("refresh_other_follow:" + categoriesId);
                                                    } else {
                                                        if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                        } else {
                                                            showImageToas(sendCodeBean.getMsg());
                                                        }
                                                    }
                                                }

                                                @Override
                                                public void onError(Response<String> response) {
                                                    super.onError(response);
                                                    dismissDialog();
                                                }
                                            });
                                        }
                                    });

                                }
                            });

                            /**
                             * 评论按钮点击事件跳转详情
                             */
                            ImageView comment = childView.findViewById(R.id.comment);
                            comment.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    myVideoView_3_2.setVideoController(null);
                                    Bundle bundle = new Bundle();
                                    VideoListBean videoListBean = new VideoListBean();
                                    videoListBean.setVideoDownloadUrl(item.getContent());
                                    videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                    videoListBean.setTitle(item.getTitle());
                                    videoListBean.setComment_num(item.getCommentSum());
                                    videoListBean.setPraise_num(item.getLikeSum());
                                    videoListBean.setHeadPhoto(item.getAvatar());
                                    videoListBean.setNickName(item.getNickname());
                                    videoListBean.setTime(item.getCreateTime());
                                    videoListBean.setIsLike(item.getIsLike());
                                    videoListBean.setAnonymity(item.getAnonymity());
                                    videoListBean.setUserId(item.getUserId());
                                    videoListBean.setContentId(item.getId());
                                    List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                    videoListBean.setList(remindJsons);
                                    videoListBean.setModule(2);
                                    bundle.putSerializable("data", videoListBean);
                                    bundle.putInt("videoId", item.getId());
                                    bundle.putString("categoriesId", categoriesId);
                                    bundle.putString("flag", "recommend");
                                    bundle.putInt("position", helper.getPosition());
                                    startActivity(VideoDetailActivity.class, bundle);
                                }
                            });


                            /**
                             * 分享
                             */
                            ImageView share = childView.findViewById(R.id.share);
                            share.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View view) {
                                    if (Utils.isDoubleClick()) {
                                        return;
                                    }
                                    contentId = item.getId();
                                    showDialog(context, null);
                                    JSONObject jsonObject = new JSONObject();
                                    try {
                                        jsonObject.put("contentId", item.getId());
                                        jsonObject.put("module", 2);
                                    } catch (JSONException e) {
                                        e.printStackTrace();
                                    }
                                    finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_DATA, null, jsonObject.toString(), new Callback<ShareFindBean>() {
                                        @Override
                                        public void onSuccess(ShareFindBean shareDataBean) {
                                            dismissDialog();
                                            if (shareDataBean.getCode() == Contacts.SUCCESS) {
                                                showFindShareDialog(shareDataBean, 2);
                                            } else {
                                                if (shareDataBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                } else {
                                                    showImageToas(shareDataBean.getMsg());
                                                }
                                            }

                                        }

                                        @Override
                                        public void onError(Response<String> response) {
                                            super.onError(response);
                                            dismissDialog();
                                        }
                                    });

                                }
                            });


                            /**
                             * 评论列表
                             */
                            XListView comment_listview = childView.findViewById(R.id.comment_listview);
                            TextView comment_count = childView.findViewById(R.id.comment_count);
                            if (item.getCommentSum() > 0) {
                                comment_count.setVisibility(View.VISIBLE);
                                comment_listview.setVisibility(View.VISIBLE);
                                comment_count.setText("共" + item.getCommentSum() + "条评论");

                                QuickAdapter<HomeChildBean.ListBean.CommentListBean> commentAdapter =
                                        new QuickAdapter<HomeChildBean.ListBean.CommentListBean>(context, R.layout.item_out_comment, item.getCommentList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper helper_comment, HomeChildBean.ListBean.CommentListBean itemComment) {
                                                TextView comment = helper_comment.getView(R.id.comment);

                                                comment.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        currentPlayPosition = item.getId();
                                                        myVideoView_3_2.setVideoController(null);
                                                        Bundle bundle = new Bundle();
                                                        VideoListBean videoListBean = new VideoListBean();
                                                        videoListBean.setVideoDownloadUrl(item.getContent());
                                                        videoListBean.setCoverImgUrl(item.getContent() + "?vframe/jpg/offset/1");
                                                        videoListBean.setTitle(item.getTitle());
                                                        videoListBean.setComment_num(item.getCommentSum());
                                                        videoListBean.setPraise_num(item.getLikeSum());
                                                        videoListBean.setHeadPhoto(item.getAvatar());
                                                        videoListBean.setNickName(item.getNickname());
                                                        videoListBean.setTime(item.getCreateTime());
                                                        videoListBean.setIsLike(item.getIsLike());
                                                        videoListBean.setAnonymity(item.getAnonymity());
                                                        videoListBean.setUserId(item.getUserId());
                                                        videoListBean.setContentId(item.getId());
                                                        videoListBean.setModule(2);
                                                        List<RemindJson> remindJsons = GsonUtil.jsonToList(item.getRemindJson(), RemindJson.class);
                                                        videoListBean.setList(remindJsons);
                                                        bundle.putSerializable("data", videoListBean);
                                                        bundle.putInt("videoId", item.getId());
                                                        bundle.putString("categoriesId", categoriesId);
                                                        bundle.putString("flag", "recommend");
                                                        bundle.putInt("position", helper.getPosition());
                                                        startActivity(VideoDetailActivity.class, bundle);
                                                    }
                                                });
                                                if (itemComment.getUserId() == item.getUserId()) {
                                                    if (item.getAnonymity() == 1) {
                                                        SpannableString content = null;

                                                        content = new SpannableString("匿名用户" + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, ("匿名用户" + " <图> " + itemComment.getComment()).indexOf("<"), ("匿名用户" + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString("匿名用户 " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, ("匿名用户").length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    } else {
                                                        SpannableString content = null;

                                                        content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                        if (itemComment.getWeight() == 1) {
                                                            content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else if (itemComment.getWeight() == -2) {
                                                            content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                        } else {
                                                            content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                        }
                                                        content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

                                                        comment.setText(content);
                                                    }
                                                } else {
                                                    SpannableString content = null;

                                                    content = new SpannableString(itemComment.getNickname() + " <图> " + itemComment.getComment());

                                                    if (itemComment.getWeight() == 1) {
                                                        content.setSpan(imageSpan, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else if (itemComment.getWeight() == -2) {
                                                        content.setSpan(imageSpan1, (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf("<"), (itemComment.getNickname() + " <图> " + itemComment.getComment()).indexOf(">") + 1, ImageSpan.ALIGN_BASELINE);
                                                    } else {
                                                        content = new SpannableString(itemComment.getNickname() + " " + itemComment.getComment());
                                                    }
                                                    content.setSpan(span, 0, itemComment.getNickname().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                                                    comment.setText(content);
                                                }

                                            }
                                        };
                                comment_listview.setAdapter(commentAdapter);
                            } else {
                                comment_count.setVisibility(View.GONE);
                                comment_listview.setVisibility(View.GONE);
                            }

                            /**
                             * 投票
                             */
                            XListView vote_num_listview = childView.findViewById(R.id.vote_num_listview);
                            if (item.getIsVote() == 0) {
                                vote_num_listview.setVisibility(View.GONE);
                            } else {
                                vote_num_listview.setVisibility(View.VISIBLE);
                                QuickAdapter<ContentVoteListBean> voteAdapter =
                                        new QuickAdapter<ContentVoteListBean>(context, R.layout.item_vote, item.getContentVoteList()) {
                                            @Override
                                            protected void convert(BaseAdapterHelper voteHelper, ContentVoteListBean voteItem) {
                                                TextView vote_tab_yes = voteHelper.getView(R.id.vote_tab_yes);
                                                TextView vote_tab_no = voteHelper.getView(R.id.vote_tab_no);
                                                TextView vote_num = voteHelper.getView(R.id.vote_num);
                                                ProgressBar progressBar = voteHelper.getView(R.id.progressBar);
                                                LinearLayout item_ll = voteHelper.getView(R.id.item_ll);

                                                if (mUserInfoBean != null) {
                                                    if (item.getUserId() == mUserInfoBean.getUser().getUserId()) {
                                                        vote_tab_yes.setVisibility(View.VISIBLE);
                                                        vote_num.setVisibility(View.VISIBLE);
                                                        progressBar.setVisibility(View.VISIBLE);
                                                        vote_tab_no.setVisibility(View.INVISIBLE);

                                                        vote_tab_yes.setText(voteItem.getName());
                                                        vote_num.setText(voteItem.getVoteSum() + "票");

                                                        progressBar.setMax(item.getVoteTotal());
                                                        progressBar.setProgress(voteItem.getVoteSum());
                                                    } else {
                                                        if (item.getIsVoted() == 1) {
                                                            vote_tab_yes.setVisibility(View.VISIBLE);
                                                            vote_num.setVisibility(View.VISIBLE);
                                                            progressBar.setVisibility(View.VISIBLE);
                                                            vote_tab_no.setVisibility(View.INVISIBLE);

                                                            vote_tab_yes.setText(voteItem.getName());
                                                            vote_num.setText(voteItem.getVoteSum() + "票");

                                                            progressBar.setMax(item.getVoteTotal());
                                                            progressBar.setProgress(voteItem.getVoteSum());
                                                        } else {
                                                            vote_tab_yes.setVisibility(View.INVISIBLE);
                                                            vote_num.setVisibility(View.INVISIBLE);
                                                            progressBar.setVisibility(View.INVISIBLE);
                                                            vote_tab_no.setVisibility(View.VISIBLE);

                                                            vote_tab_no.setText(voteItem.getName());
                                                        }
                                                    }
                                                } else {
                                                    vote_tab_yes.setVisibility(View.INVISIBLE);
                                                    vote_num.setVisibility(View.INVISIBLE);
                                                    progressBar.setVisibility(View.INVISIBLE);
                                                    vote_tab_no.setVisibility(View.VISIBLE);

                                                    vote_tab_no.setText(voteItem.getName());
                                                }

                                                item_ll.setOnClickListener(new View.OnClickListener() {
                                                    @Override
                                                    public void onClick(View view) {
                                                        if (Utils.isDoubleClick()) {
                                                            return;
                                                        }
                                                        if (item.getIsVoted() == 1) {
                                                            if (voteItem.getIsVote() == 1) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "取消中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.CANCE_HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(0);
                                                                            item.setVoteTotal(item.getVoteTotal() - 1);
                                                                            voteItem.setIsVote(0);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() - 1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        } else {
                                                            if (voteItem.getIsVote() == 0) {
                                                                item_ll.setEnabled(false);
                                                                showDialog(context, "投票中...");
                                                                JSONObject jsonObject = new JSONObject();
                                                                try {
                                                                    jsonObject.put("contentId", voteItem.getContentId());
                                                                    jsonObject.put("contentVoteId", voteItem.getId());
                                                                } catch (JSONException e) {
                                                                    e.printStackTrace();
                                                                }
                                                                finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.HOME_VOTE, null, jsonObject.toString(), new Callback<SendCodeBean>() {
                                                                    @Override
                                                                    public void onSuccess(SendCodeBean sendCodeBean) {
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                        if (sendCodeBean.getCode() == Contacts.SUCCESS) {
                                                                            item.setIsVoted(1);
                                                                            item.setVoteTotal(item.getVoteTotal() + 1);
                                                                            voteItem.setVoteSum(voteItem.getVoteSum() + 1);
                                                                            voteItem.setIsVote(1);
                                                                            notifyDataSetChanged();
                                                                        } else {
                                                                            if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                                                                            } else {
//                                                                                showImageToas(sendCodeBean.getMsg());
                                                                            }
                                                                        }
                                                                    }

                                                                    @Override
                                                                    public void onError(Response<String> response) {
                                                                        super.onError(response);
                                                                        dismissDialog();
                                                                        item_ll.setEnabled(true);
                                                                    }
                                                                });
                                                            }
                                                        }
                                                    }
                                                });

                                            }
                                        };
                                vote_num_listview.setAdapter(voteAdapter);
                            }

                        }
                    }
                }

            }
        };

        listview.setAdapter(quickAdapter);
        listview.setOnScrollListener(new AbsListView.OnScrollListener() {

            private boolean isFlag;

            @Override
            public void onScrollStateChanged(AbsListView absListView, int scrollState) {
                switch (scrollState) {
                    case AbsListView.OnScrollListener.SCROLL_STATE_IDLE://停止滚动
                        /**在这里执行，视频的自动播放与停止*/
//                        Glide.with(context).resumeRequests();
                        isFlag = false;
                        if (PlayerUtils.getNetworkType(context) == PlayerUtils.NETWORK_MOBILE) {
                        } else {
                            autoPlayVideo(absListView);
                        }
                        keepStop(absListView);
                        break;
                    case AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL://拖动
                        isFlag = true;
//                        mPreloadManager.removeAllPreloadTask();
//                        Glide.with(context).pauseRequests();
                        break;
                    case AbsListView.OnScrollListener.SCROLL_STATE_FLING://惯性滑动
                        isFlag = true;
//                        mPreloadManager.removeAllPreloadTask();
//                        Glide.with(context).pauseRequests();
                        break;
                }
            }

            private void keepStop(AbsListView view) {
                if (refreshLayout.getState() != RefreshState.Loading) {
                    for (int i = 0; i < view.getChildCount(); i++) {
                        if (view == null || view.getChildAt(i) == null) continue;
                        LinearLayout itemLl = view.getChildAt(i).findViewById(R.id.item_ll);
                        if (itemLl != null) {
                            int position = (int) itemLl.getTag();
                            if (quickAdapter.getItem(position).isShowEdit()) {
                            } else {
                                Rect rect = new Rect();
                                itemLl.getLocalVisibleRect(rect);
                                int videoHeight = itemLl.getHeight();
                                RelativeLayout comment_rl = view.getChildAt(i).findViewById(R.id.comment_rl);
                                if (comment_rl != null) {
                                    if ((rect.top <= videoHeight / 2 && rect.bottom == videoHeight)) {
                                        Handler handler = new Handler();
                                        handler.postDelayed(new Runnable() {
                                            @Override
                                            public void run() {
                                                comment_rl.setVisibility(View.VISIBLE);
                                                if (quickAdapter.getItem(position) != null) {
                                                    quickAdapter.getItem(position).setShowEdit(true);
                                                }
                                            }
                                        }, 5000);
                                        return;
                                    }
                                }
                            }

                        }
                    }
                }
            }

            @Override
            public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
                if (isFlag) {
                    if (PlayerUtils.getNetworkType(context) == PlayerUtils.NETWORK_MOBILE) {
                    } else {
                        autoPlayVideo(absListView);
                    }
                } else {
                }
            }


            private void autoPlayVideo(AbsListView view) {
                //循环遍历可视区域videoview,如果完全可见就开始播放
                for (int i = 0; i < view.getChildCount(); i++) {
                    if (view == null || view.getChildAt(i) == null) continue;

                    FrameLayout frameLayout = view.getChildAt(i).findViewById(R.id.my_container);
                    LinearLayout itemLl = view.getChildAt(i).findViewById(R.id.item_ll);
                    if (frameLayout != null) {
                        Rect rect = new Rect();
                        frameLayout.getLocalVisibleRect(rect);
                        int videoHeight = frameLayout.getHeight();
                        int position = (int) itemLl.getTag();
                        if ((rect.top == 0 && rect.bottom >= videoHeight / 2) || (rect.top <= videoHeight / 2 && rect.bottom == videoHeight)) {
                            if (VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()) != null) {
                                if (VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).isPlaying()) {
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).setMute(true);
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).setMute(true);
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).resume();
                                } else {
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).setMute(true);
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).start();
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).setMute(true);
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).start();
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).setMute(true);
                                    VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).start();
                                }
                            }
                            currentPlayPosition = quickAdapter.getItem(position).getId();
                            return;
                        } else {
                            if (VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()) != null) {
                                VideoHashMap.getIntance().get(quickAdapter.getItem(position).getId()).pause();
                            }
                        }
                    } else {
                        currentPlayPosition = -1;
                    }
                }
            }


        });

        return view;
    }

    private String share_flag = "";

    private void showFindShareDialog(ShareFindBean shareDataBean, int moduleInt) {
        this.moduleInt = moduleInt;

        DialogUtil.getInstance().showBottomDialog(context, R.layout.dialog_share);
        LinearLayout dialog_share = (LinearLayout) DialogUtil.getInstance().dialog_bottom_layout;
        dialog_share.findViewById(R.id.close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (Utils.isDoubleClick()) {
                    return;
                }
                DialogUtil.getInstance().dialog_bottom.dismiss();
            }
        });

        dialog_share.findViewById(R.id.share_wechat).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "weixin";
            WXShareUtil wxShareUtil = new WXShareUtil(context);
            wxShareUtil.registerWx();
            WechatLoginUtil.getInstance().setWechatCallBack(RecommendFragment.this);
            String url = "";
            if (shareDataBean.getDiscover().getType() == 2) {
                url = shareDataBean.getDiscover().getContent() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getDiscover().getType() == 1) {
                url = shareDataBean.getDiscover().getImage().split("\\|")[0] + "?imageView2/2/w/100";
            } else {
                url = "";
            }
            wxShareUtil.share(shareDataBean.getUrl(),
                    shareDataBean.getDiscover().getTitle(),
                    "",
                    url, wxShareUtil.SHARETOFRIEND);
        });

        dialog_share.findViewById(R.id.share_wechat_friend).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "weixin";
            WXShareUtil wxShareUtil = new WXShareUtil(context);
            wxShareUtil.registerWx();
            WechatLoginUtil.getInstance().setWechatCallBack(RecommendFragment.this);
            String url = "";
            if (shareDataBean.getDiscover().getType() == 2) {
                url = shareDataBean.getDiscover().getContent() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getDiscover().getType() == 1) {
                url = shareDataBean.getDiscover().getImage().split("\\|")[0] + "?imageView2/2/w/100";
            } else {
                url = "";
            }
            wxShareUtil.share(shareDataBean.getUrl(),
                    shareDataBean.getDiscover().getTitle(),
                    "",
                    url, wxShareUtil.SHARETOPYQ);
        });

        dialog_share.findViewById(R.id.share_qq).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "qq";
            String url = "";
            if (shareDataBean.getDiscover().getType() == 2) {
                url = shareDataBean.getDiscover().getContent() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getDiscover().getType() == 1) {
                url = shareDataBean.getDiscover().getImage().split("\\|")[0] + "?imageView2/2/w/100";
            } else {
                url = "";
            }
            mTencent = Tencent.createInstance(Config.QQ_APP_ID, ContextUtil.getContext());
            Bundle params = new Bundle();
            params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
            params.putString(QQShare.SHARE_TO_QQ_TITLE, shareDataBean.getDiscover().getTitle());
            params.putString(QQShare.SHARE_TO_QQ_SUMMARY, "");
            params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, url);
            params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, shareDataBean.getUrl());
            mTencent.shareToQQ(context, params, new BaseUiListener());
            shareSuccess();
        });

        dialog_share.findViewById(R.id.share_qq_space).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "qq";
            String url = "";
            if (shareDataBean.getDiscover().getType() == 2) {
                url = shareDataBean.getDiscover().getContent() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getDiscover().getType() == 1) {
                url = shareDataBean.getDiscover().getImage().split("\\|")[0] + "?imageView2/2/w/100";
            } else {
                url = "";
            }
            mTencent = Tencent.createInstance(Config.QQ_APP_ID, context);
            Bundle params = new Bundle();
            params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
            params.putString(QzoneShare.SHARE_TO_QQ_TITLE, shareDataBean.getDiscover().getTitle());//选填
            params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, "");
            params.putString(QzoneShare.SHARE_TO_QQ_IMAGE_URL, url);
            params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, shareDataBean.getUrl());
            params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, new ArrayList<String>());
            mTencent.shareToQzone(context, params, new BaseUiListener());
            shareSuccess();
        });

        dialog_share.findViewById(R.id.share_weibo).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "weibo";
            WbSdk.install(ContextUtil.getContext(), new AuthInfo(ContextUtil.getContext(), Config.SINA_APP_KEY, Config.REDIRECT_URL, ""));
            WbShareHandler shareHandler = new WbShareHandler(context);
            shareHandler.registerApp();
            WeiboMultiMessage weiboMessage = new WeiboMultiMessage();
            weiboMessage.textObject = getTextObj(shareDataBean.getUrl(), shareDataBean.getDiscover().getTitle());
            shareHandler.shareMessage(weiboMessage, false);
            shareSuccess();
        });

        dialog_share.findViewById(R.id.copy_link).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
            // 创建一个剪贴数据集，包含一个普通文本数据条目（需要复制的数据）
            ClipData clipData = ClipData.newPlainText(null, shareDataBean.getUrl());
            // 把数据集设置（复制）到剪贴板
            clipboard.setPrimaryClip(clipData);
            showToast("链接已复制");
        });

        dialog_share.findViewById(R.id.copy_text).setVisibility(View.INVISIBLE);

        dialog_share.findViewById(R.id.black_list).setVisibility(View.INVISIBLE);

        dialog_share.findViewById(R.id.report).setVisibility(View.INVISIBLE);

    }

    private void showShareDialog(ShareDataBean shareDataBean, int moduleInt) {
        this.moduleInt = moduleInt;

        DialogUtil.getInstance().showBottomDialog(context, R.layout.dialog_share);
        LinearLayout dialog_share = (LinearLayout) DialogUtil.getInstance().dialog_bottom_layout;
        dialog_share.findViewById(R.id.close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (Utils.isDoubleClick()) {
                    return;
                }
                DialogUtil.getInstance().dialog_bottom.dismiss();
            }
        });

        dialog_share.findViewById(R.id.share_wechat).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "weixin";
            WXShareUtil wxShareUtil = new WXShareUtil(context);
            wxShareUtil.registerWx();
            WechatLoginUtil.getInstance().setWechatCallBack(RecommendFragment.this);
            String url = "";
            if (shareDataBean.getContent().getType() == 1) {
                url = shareDataBean.getContent().getUrls() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getContent().getType() == 2) {
                url = shareDataBean.getContent().getUrls().split("\\|")[0] + "?imageView2/2/w/100";
            } else if (shareDataBean.getContent().getType() == 3) {
                url = "";
            }
            wxShareUtil.share(shareDataBean.getUrl(),
                    shareDataBean.getContent().getTitle(),
                    "",
                    url, wxShareUtil.SHARETOFRIEND);
        });

        dialog_share.findViewById(R.id.share_wechat_friend).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "weixin";
            WXShareUtil wxShareUtil = new WXShareUtil(context);
            wxShareUtil.registerWx();
            WechatLoginUtil.getInstance().setWechatCallBack(RecommendFragment.this);
            String url = "";
            if (shareDataBean.getContent().getType() == 1) {
                url = shareDataBean.getContent().getUrls() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getContent().getType() == 2) {
                url = shareDataBean.getContent().getUrls().split("\\|")[0] + "?imageView2/2/w/100";
            } else if (shareDataBean.getContent().getType() == 3) {
                url = "";
            }
            wxShareUtil.share(shareDataBean.getUrl(),
                    shareDataBean.getContent().getTitle(),
                    "",
                    url, wxShareUtil.SHARETOPYQ);
        });

        dialog_share.findViewById(R.id.share_qq).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "qq";
            String url = "";
            if (shareDataBean.getContent().getType() == 1) {
                url = shareDataBean.getContent().getUrls() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getContent().getType() == 2) {
                url = shareDataBean.getContent().getUrls().split("\\|")[0] + "?imageView2/2/w/100";
            } else if (shareDataBean.getContent().getType() == 3) {
                url = "";
            }
            mTencent = Tencent.createInstance(Config.QQ_APP_ID, ContextUtil.getContext());
            Bundle params = new Bundle();
            params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
            params.putString(QQShare.SHARE_TO_QQ_TITLE, shareDataBean.getContent().getTitle());
            params.putString(QQShare.SHARE_TO_QQ_SUMMARY, "");
            params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, url);
            params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, shareDataBean.getUrl());
            baseUiListener = new BaseUiListener();
            mTencent.shareToQQ(context, params, baseUiListener);
            shareSuccess();
        });

        dialog_share.findViewById(R.id.share_qq_space).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "qq";
            String url = "";
            if (shareDataBean.getContent().getType() == 1) {
                url = shareDataBean.getContent().getUrls() + "?vframe/jpg/offset/1";
            } else if (shareDataBean.getContent().getType() == 2) {
                url = shareDataBean.getContent().getUrls().split("\\|")[0] + "?imageView2/2/w/100";
            } else if (shareDataBean.getContent().getType() == 3) {
                url = "";
            }
            mTencent = Tencent.createInstance(Config.QQ_APP_ID, context);
            Bundle params = new Bundle();
            params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
            params.putString(QzoneShare.SHARE_TO_QQ_TITLE, shareDataBean.getContent().getTitle());//选填
            params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, "");
            params.putString(QzoneShare.SHARE_TO_QQ_IMAGE_URL, url);
            params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, shareDataBean.getUrl());
            params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, new ArrayList<String>());
            baseUiListener = new BaseUiListener();
            mTencent.shareToQzone(context, params, baseUiListener);
            shareSuccess();
        });

        dialog_share.findViewById(R.id.share_weibo).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            share_flag = "weibo";
            WbSdk.install(ContextUtil.getContext(), new AuthInfo(ContextUtil.getContext(), Config.SINA_APP_KEY, Config.REDIRECT_URL, ""));
            shareHandler = new WbShareHandler(context);
            shareHandler.registerApp();
            WeiboMultiMessage weiboMessage = new WeiboMultiMessage();
            weiboMessage.textObject = getTextObj(shareDataBean.getUrl(), shareDataBean.getContent().getTitle());
            shareHandler.shareMessage(weiboMessage, false);
            shareSuccess();
        });

        dialog_share.findViewById(R.id.copy_link).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
            // 创建一个剪贴数据集，包含一个普通文本数据条目（需要复制的数据）
            ClipData clipData = ClipData.newPlainText(null, shareDataBean.getUrl());
            // 把数据集设置（复制）到剪贴板
            clipboard.setPrimaryClip(clipData);
            showToast("链接已复制");
        });

        dialog_share.findViewById(R.id.copy_text).setOnClickListener(view -> {
            if (Utils.isDoubleClick()) {
                return;
            }
            DialogUtil.getInstance().dialog_bottom.dismiss();
            ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
            // 创建一个剪贴数据集，包含一个普通文本数据条目（需要复制的数据）
            ClipData clipData = ClipData.newPlainText(null, shareDataBean.getContent().getTitle());
            // 把数据集设置（复制）到剪贴板
            clipboard.setPrimaryClip(clipData);
            showToast("文字已复制");
        });

        dialog_share.findViewById(R.id.black_list).setVisibility(View.INVISIBLE);

        dialog_share.findViewById(R.id.report).setVisibility(View.INVISIBLE);
    }

    @Override
    public void onWbShareSuccess() {
//        showToast("分享成功");
//        shareSuccess();
    }

    private void shareSuccess() {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("contentId", contentId);
            jsonObject.put("module", moduleInt);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        finalOkGo.requestHead(RequestType.POSTJSONHEAD, Url.SHARE_SUCCESS, null, jsonObject.toString(), new Callback<SendCodeBean>() {
            @Override
            public void onSuccess(SendCodeBean sendCodeBean) {
                if (sendCodeBean.getCode() == Contacts.SUCCESS) {

                } else {
                    if (sendCodeBean.getCode() == Contacts.TOKEN_EMPTY) {
                    } else {
                        showImageToas(sendCodeBean.getMsg());
                    }
                }
            }
        });
    }

    @Override
    public void onWbShareCancel() {
//        showImageToas("分享取消");
    }

    @Override
    public void onWbShareFail() {
//        showImageToas("分享失败");
    }

    @Override
    public void callBack(BaseResp baseResp) {
        switch (baseResp.errCode) {
            case BaseResp.ErrCode.ERR_OK:
                showToast("分享成功");
                shareSuccess();
                break;
            case BaseResp.ErrCode.ERR_USER_CANCEL:
                showImageToas("分享取消");
                break;
            case BaseResp.ErrCode.ERR_AUTH_DENIED:
                showImageToas("分享被拒绝");
                break;
            default:
                showImageToas("分享返回");
                break;
        }
    }

    private class BaseUiListener implements IUiListener {

        @Override
        public void onComplete(Object o) {
//            showToast("分享成功");
            shareSuccess();
        }

        @Override
        public void onError(UiError uiError) {
//            showImageToas("分享失败");
        }

        @Override
        public void onCancel() {
//            showImageToas("分享取消");
        }
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (share_flag.equals("weibo")) {
            Logger.e("++++++++++++++");
            shareHandler.doResultIntent(data, this);
        } else if (share_flag.equals("qq")) {
            if (mTencent != null) {
                Tencent.onActivityResultData(requestCode, resultCode, data, baseUiListener);
//                mTencent.onActivityResult(requestCode, resultCode, data);
            }
        }
    }


    private TextObject getTextObj(String url, String title) {
        TextObject textObject = new TextObject();
        textObject.text = title + "\n" + url;
        textObject.title = title;
        textObject.actionUrl = url;
        return textObject;
    }

    @Override
    protected void initData() {
        showDialog(context, null);
        requestData();
    }

    private void requestData() {

        HttpParams params = new HttpParams();
        params.put("categoriesId", categoriesId);
        params.put("limit", 10);
        if (mUserInfoBean != null) {
            params.put("userId", mUserInfoBean.getUser().getUserId());
        } else {
            if (!TextUtils.isEmpty(ExampleUtil.getImei(context, ""))) {
                params.put("uuid", ExampleUtil.getImei(context, ""));
            } else {
                if (!TextUtils.isEmpty(JPushInterface.getUdid(context))) {
                    params.put("uuid", JPushInterface.getUdid(context));
                } else {
                    if (!TextUtils.isEmpty(JPushInterface.getRegistrationID(context))) {
                        params.put("uuid", JPushInterface.getRegistrationID(context));
                    } else {
                        params.put("uuid", System.currentTimeMillis() + "");
                    }
                }
            }
        }
        if (lat != 0) {
            params.put("lat", lat);
        }
        if (lot != 0) {
            params.put("lon", lot);
        }
        finalOkGo.request(RequestType.POST, Url.HOME_TAB_CHILD, params, Url.HOME_TAB_CHILD, new Callback<HomeChildBean>() {
            @Override
            public void onSuccess(HomeChildBean homeChildBean) {
                if (homeChildBean.getCode() == Contacts.SUCCESS) {
                    if (!categoriesId.equals("1") && !categoriesId.equals("5")) {
                        if (mUserInfoBean != null) {
                            if (homeChildBean.getDistance() == 0) {
                                AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
                                alphaAnimation.setDuration(1500);
                                alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
                                    @Override
                                    public void onAnimationStart(Animation animation) {

                                    }

                                    @Override
                                    public void onAnimationEnd(Animation animation) {
                                        no_data.setVisibility(View.VISIBLE);
                                        alphaAnimation.cancel();
                                        no_data.clearAnimation();
                                        AlphaAnimation alphaAnimation1 = new AlphaAnimation(1, 0);
                                        alphaAnimation1.setDuration(1500);
                                        alphaAnimation1.setStartOffset(1000);
                                        alphaAnimation1.setAnimationListener(new Animation.AnimationListener() {
                                            @Override
                                            public void onAnimationStart(Animation animation) {

                                            }

                                            @Override
                                            public void onAnimationEnd(Animation animation) {
                                                no_data.setVisibility(View.INVISIBLE);
                                                alphaAnimation1.cancel();
                                                no_data.clearAnimation();
                                            }

                                            @Override
                                            public void onAnimationRepeat(Animation animation) {

                                            }
                                        });
                                        no_data.setAnimation(alphaAnimation1);
                                        alphaAnimation1.startNow();
                                    }

                                    @Override
                                    public void onAnimationRepeat(Animation animation) {

                                    }
                                });
                                no_data.setAnimation(alphaAnimation);
                                alphaAnimation.startNow();
                            } else {
                                no_data.setVisibility(View.INVISIBLE);
                            }
                        }

                    }

                    if (homeChildBean.getList() == null || homeChildBean.getList().size() == 0) {
                        if (categoriesId.equals("5")) {
                            empty_img.setVisibility(View.VISIBLE);
                            empty_img.setImageResource(R.mipmap.icon_no_follow);
                        }
                    } else {
                        empty_img.setVisibility(View.GONE);
                    }

                    for (int i = 0; i < homeChildBean.getList().size(); i++) {
                        if (homeChildBean.getList().get(i).getModule() == 1 || homeChildBean.getList().get(i).getModule() == 0) {
                            if (homeChildBean.getList().get(i).getType() == 1) {
                                VideoView videoView = new VideoView(context);
                                videoView.setMute(true);
                                VideoHashMap.getIntance().put(homeChildBean.getList().get(i).getId(), videoView);

                                mPreloadManager.addPreloadTask(homeChildBean.getList().get(i).getUrls(), homeChildBean.getList().get(i).getId());

                                int finalI = i;
                                if (homeChildBean.getList().get(finalI).getWidth() == 0) {
                                    Glide.with(context)
                                            .load(homeChildBean.getList().get(i).getUrls() + "?vframe/jpg/offset/1")
                                            .asBitmap()
                                            .into(new SimpleTarget<Bitmap>() {
                                                @Override
                                                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                                                    homeChildBean.getList().get(finalI).setWidth(resource.getWidth());
                                                    homeChildBean.getList().get(finalI).setHeight(resource.getHeight());
                                                }
                                            });
                                }
                            }
                        } else {
                            if (homeChildBean.getList().get(i).getType() == 2) {
                                VideoView videoView = new VideoView(context);
                                videoView.setMute(true);
                                VideoHashMap.getIntance().put(homeChildBean.getList().get(i).getId(), videoView);

                                mPreloadManager.addPreloadTask(homeChildBean.getList().get(i).getContent(), homeChildBean.getList().get(i).getId());

                                int finalI = i;
                                if (homeChildBean.getList().get(finalI).getWidth() == 0) {
                                    Glide.with(context)
                                            .load(homeChildBean.getList().get(i).getContent() + "?vframe/jpg/offset/1")
                                            .asBitmap()
                                            .into(new SimpleTarget<Bitmap>() {
                                                @Override
                                                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                                                    homeChildBean.getList().get(finalI).setWidth(resource.getWidth());
                                                    homeChildBean.getList().get(finalI).setHeight(resource.getHeight());
                                                }


                                            });
                                }

                            }
                        }

                    }
                    quickAdapter.clear();
                    quickAdapter.addAll(homeChildBean.getList());
                    quickAdapter.notifyDataSetChanged();
                    refreshLayout.finishRefresh();
                } else {
                    if (categoriesId.equals("5")) {
                        empty_img.setVisibility(View.VISIBLE);
                        empty_img.setImageResource(R.mipmap.icon_no_follow);
                    } else {
                        showImageToas("网络开小差了...");
                        empty_img.setVisibility(View.GONE);
                    }
                    refreshLayout.finishRefresh();
                }
                dismissDialog();
            }

            @Override
            public void onError(Response<String> response) {
                super.onError(response);
                quickAdapter.clear();
                quickAdapter.notifyDataSetChanged();
                if (empty_img != null) {
                    empty_img.setVisibility(View.VISIBLE);
                    empty_img.setImageResource(R.mipmap.icon_no_net);
                }
                if (refreshLayout != null) {
                    refreshLayout.finishRefresh();
                }
                dismissDialog();

            }
        });
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        if (VideoHashMap.getIntance() != null) {
            VideoHashMap.getIntance().clear();
        }
        EventBus.getDefault().unregister(this);
        mPreloadManager.removeAllPreloadTask();
        unbinder.unbind();
    }


    @Override
    public void onPause() {
        super.onPause();
        VideoViewManager.instance().pause();
    }


    @Override
    public void onResume() {
        super.onResume();
        if (currentPlayPosition != -1) {
            quickAdapter.notifyDataSetChanged();
            VideoHashMap.getIntance().get(currentPlayPosition).resume();
        }
    }

    @Override
    public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
        HttpParams params = new HttpParams();
        params.put("categoriesId", categoriesId);
        params.put("limit", 10);
        if (mUserInfoBean != null) {
            params.put("userId", mUserInfoBean.getUser().getUserId());
        } else {
            if (!TextUtils.isEmpty(ExampleUtil.getImei(context, ""))) {
                params.put("uuid", ExampleUtil.getImei(context, ""));
            } else {
                if (!TextUtils.isEmpty(JPushInterface.getUdid(context))) {
                    params.put("uuid", JPushInterface.getUdid(context));
                } else {
                    if (!TextUtils.isEmpty(JPushInterface.getRegistrationID(context))) {
                        params.put("uuid", JPushInterface.getRegistrationID(context));
                    } else {
                        params.put("uuid", System.currentTimeMillis() + "");
                    }
                }
            }
        }
        if (lat != 0) {
            params.put("lat", lat);
        }
        if (lot != 0) {
            params.put("lon", lot);
        }
        try {
            params.put("startTime", quickAdapter.getItem(quickAdapter.getCount() - 1).getCreateTime());
        } catch (Exception e) {
        }
        finalOkGo.request(RequestType.POST, Url.HOME_TAB_CHILD, params, Url.HOME_TAB_CHILD, new Callback<HomeChildBean>() {
            @Override
            public void onSuccess(HomeChildBean homeChildBean) {
                if (homeChildBean.getCode() == Contacts.SUCCESS) {
                    if (homeChildBean.getList() == null || homeChildBean.getList().size() == 0) {
                        refreshLayout.finishLoadMoreWithNoMoreData();
                    } else {
                        for (int i = 0; i < homeChildBean.getList().size(); i++) {
                            if (homeChildBean.getList().get(i).getModule() == 1 || homeChildBean.getList().get(i).getModule() == 0) {
                                if (homeChildBean.getList().get(i).getType() == 1) {
                                    VideoView videoView = new VideoView(context);
                                    videoView.setMute(true);
                                    VideoHashMap.getIntance().put(homeChildBean.getList().get(i).getId(), videoView);

                                    mPreloadManager.addPreloadTask(homeChildBean.getList().get(i).getUrls(), homeChildBean.getList().get(i).getId());

                                    int finalI = i;
                                    if (homeChildBean.getList().get(finalI).getWidth() == 0) {
                                        Glide.with(context)
                                                .load(homeChildBean.getList().get(i).getUrls() + "?vframe/jpg/offset/1")
                                                .asBitmap()
                                                .into(new SimpleTarget<Bitmap>() {
                                                    @Override
                                                    public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                                                        homeChildBean.getList().get(finalI).setWidth(resource.getWidth());
                                                        homeChildBean.getList().get(finalI).setHeight(resource.getHeight());
                                                    }


                                                });
                                    }

                                }
                            } else {
                                if (homeChildBean.getList().get(i).getType() == 2) {
                                    VideoView videoView = new VideoView(context);
                                    videoView.setMute(true);
                                    VideoHashMap.getIntance().put(homeChildBean.getList().get(i).getId(), videoView);

                                    mPreloadManager.addPreloadTask(homeChildBean.getList().get(i).getContent(), homeChildBean.getList().get(i).getId());

                                    int finalI = i;
                                    if (homeChildBean.getList().get(finalI).getWidth() == 0) {
                                        Glide.with(context)
                                                .load(homeChildBean.getList().get(i).getContent() + "?vframe/jpg/offset/1")
                                                .asBitmap()
                                                .into(new SimpleTarget<Bitmap>() {
                                                    @Override
                                                    public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {

                                                        homeChildBean.getList().get(finalI).setWidth(resource.getWidth());
                                                        homeChildBean.getList().get(finalI).setHeight(resource.getHeight());

                                                    }


                                                });
                                    }

                                }
                            }
                        }
                        quickAdapter.addAll(homeChildBean.getList());
                        quickAdapter.notifyDataSetChanged();
                        refreshLayout.finishLoadMore();
                    }
                } else {
                    refreshLayout.finishLoadMore();
//                    showImageToas("网络开小差了...");
                }
            }

            @Override
            public void onError(Response<String> response) {
                super.onError(response);
                refreshLayout.finishLoadMore();
            }
        });
    }

    @Override
    public void onRefresh(@NonNull RefreshLayout refreshLayout) {
//        initData();
        EventBus.getDefault().post("home_refresh_location");

    }

    public void scrollToTop() {
        listview.setSelection(0);
    }

    public void refreshHome() {
//        refreshLayout.autoRefresh();
        initData();
    }

    @Subscribe(threadMode = ThreadMode.POSTING, sticky = true)
    public void OnMessageEvent(String event) {
        String s = event.split(":")[0];
        if (s.equals("refresh_other_follow")) {
            if (!categoriesId.equals(event.split(":")[1])) {
                requestData();
            }
        } else if (s.equals("refresh_data")) {
            if (categoriesId.equals(event.split(":")[1])) {
//                scrollToTop();
//                refreshLayout.autoRefresh();
                requestData();
            }
        } else if (s.equals("scollTo_top")) {
            if (categoriesId.equals(event.split(":")[1])) {
                scrollToTop();
            }
        } else if (s.equals("refresh_home_cancel_praise")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setLikeSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getLikeSum() - 1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setIsLike(0);
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("refresh_home_praise")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setLikeSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getLikeSum() + 1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setIsLike(1);
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("refresh_location_home")) {
            lat = Double.parseDouble(event.split(":")[1]);
            lot = Double.parseDouble(event.split(":")[2]);
            initData();
        } else if (s.equals("refresh_detail_follow")) {
            if (categoriesId.equals(event.split(":")[1])) {
                for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                    if (quickAdapter.getItem(i).getUserId() == Integer.parseInt(event.split(":")[2])) {
                        quickAdapter.getItem(i).setIsAttention(1);
                    }
                }
                quickAdapter.notifyDataSetChanged();
            }
            if (!categoriesId.equals(event.split(":")[1])) {
                requestData();
            }
        } else if (s.equals("refresh_detail_cancel_follow")) {
            if (categoriesId.equals(event.split(":")[1])) {
                for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                    if (quickAdapter.getItem(i).getUserId() == Integer.parseInt(event.split(":")[2])) {
                        quickAdapter.getItem(i).setIsAttention(0);
                    }
                }
                quickAdapter.notifyDataSetChanged();
            }
            if (!categoriesId.equals(event.split(":")[1])) {
                requestData();
            }
        } else if (s.equals("black_detail_list")) {
            if (categoriesId.equals(event.split(":")[1])) {
                for (int i = quickAdapter.getCount() - 1; i >= 0; i--) {
                    if (quickAdapter.getItem(i).getUserId() == Integer.parseInt(event.split(":")[2])) {
                        quickAdapter.remove(i);
                    }
                }
                quickAdapter.notifyDataSetChanged();
            }
            if (!categoriesId.equals(event.split(":")[1])) {
                requestData();
            }
        } else if (s.equals("delete_detail")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.remove(Integer.parseInt(event.split(":")[2]));
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("refresh_home_comment")) {
            if (categoriesId.equals(event.split(":")[1])) {
                HomeChildBean.ListBean.CommentListBean commentListBean = new HomeChildBean.ListBean.CommentListBean();
                commentListBean.setComment(event.split(":")[3]);
                commentListBean.setNickname(mUserInfoBean.getUser().getNickname());
                if (quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentSum() < 2) {
                    quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentList().add(commentListBean);
                } else {
                    quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentList().set(0, commentListBean);
                }
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setCommentSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentSum() + 1);
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("refresh_home_comment_count")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setCommentSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentSum() + 1);
                quickAdapter.notifyDataSetChanged();
            }
        } else if (event.equals("recommend_position==-1")) {
            currentPlayPosition = -1;
        } else if (event.equals("refresh_home_data")) {
            requestData();
        } else if (s.equals("delete_home_comment_count")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setCommentSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentSum() - 1);
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("delete_home_comment")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setCommentSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentSum() - 1);
                for (int i = quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentList().size() - 1; i >= 0; i--) {
                    if (quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentList().get(i).getComment().equals(event.split(":")[3])) {
                        quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getCommentList().remove(i);
                    }
                }
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("refresh_other_list_cancel_praise")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setLikeSum(quickAdapter.getItem(i).getLikeSum() - 1);
                    quickAdapter.getItem(i).setIsLike(0);
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("refresh_other_list_praise")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setLikeSum(quickAdapter.getItem(i).getLikeSum() + 1);
                    quickAdapter.getItem(i).setIsLike(1);
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("refresh_mine_cancel_praise")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setLikeSum(quickAdapter.getItem(i).getLikeSum() - 1);
                    quickAdapter.getItem(i).setIsLike(0);
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("refresh_mine_praise")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setLikeSum(quickAdapter.getItem(i).getLikeSum() + 1);
                    quickAdapter.getItem(i).setIsLike(1);
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("comment_detial_add_home")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setCommentSum(quickAdapter.getItem(i).getCommentSum() + 1);
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("comment_detial_sub_home")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setCommentSum(quickAdapter.getItem(i).getCommentSum() - 1);
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("comment_detial_sub_home_content")) {
            for (int i = 0; i < quickAdapter.getCount(); i++) {
                if ((quickAdapter.getItem(i).getId() + "").equals(event.split(":")[1])) {
                    quickAdapter.getItem(i).setCommentSum(quickAdapter.getItem(i).getCommentSum() - 1);
                    for (int j = 0; j < quickAdapter.getItem(i).getCommentList().size(); j++) {
                        if (quickAdapter.getItem(i).getCommentList().get(j).getComment().equals(event.split(":")[2])) {
                            quickAdapter.getItem(i).getCommentList().remove(j);
                        }
                    }
                    quickAdapter.notifyDataSetChanged();
                }
            }
        } else if (s.equals("refresh_home_vote")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setVoteTotal(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getVoteTotal() + 1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setIsVoted(1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getContentVoteList().get(Integer.parseInt(event.split(":")[3])).setVoteSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getContentVoteList().get(Integer.parseInt(event.split(":")[3])).getVoteSum() + 1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getContentVoteList().get(Integer.parseInt(event.split(":")[3])).setIsVote(1);
                quickAdapter.notifyDataSetChanged();
            }
        } else if (s.equals("refresh_cancel_home_vote")) {
            if (categoriesId.equals(event.split(":")[1])) {
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setVoteTotal(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getVoteTotal() - 1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).setIsVoted(0);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getContentVoteList().get(Integer.parseInt(event.split(":")[3])).setVoteSum(quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getContentVoteList().get(Integer.parseInt(event.split(":")[3])).getVoteSum() - 1);
                quickAdapter.getItem(Integer.parseInt(event.split(":")[2])).getContentVoteList().get(Integer.parseInt(event.split(":")[3])).setIsVote(0);
                quickAdapter.notifyDataSetChanged();
            }
        }
    }
}
